How to limit snapshot transaction buildiup?
645601Jun 26 2008 — edited Jun 27 2008Using 4.7.25 with 2GB cache on Ubuntu 8 (64 bit).
Env flags:
DB_CREATE |
DB_INIT_TXN |
DB_INIT_LOCK |
DB_INIT_LOG |
DB_INIT_MPOOL |
DB_SYSTEM_MEM |
DB_REGISTER |
DB_RECOVER |
DB_THREAD
db config file has;
set_flags DB_MULTIVERSION
set_flags DB_AUTO_COMMIT
with db open flags;
DB_CREATE
DB_THREAD
DB_AUTO_COMMIT
then write 500000 records to btree with incrementing numeric key stored as string not integer in their own individual transaction and watch db-stat -t. after a while snapshot transactions will consume all resources and the writes will fail.
transaction created via
envp->txn_begin(envp, NULL, &wtx, DB_READ_COMMITTED);
twobdb->dbp->put(twobdb->dbp, wtx, &key, &data, 0);
wtx->commit(wtx, 0);
but with error checking of course.
it seems that the autocreated snapshot transactions are never committed. i presume that this is something to do with me not having the flags quite correct for the transaction or perhaps the environment or database as all this is is a single write process and surely the snapshot transactions should commit at some point
anyone have any pointers as to what i am doing wrong here as the transactions don't even commit after the program ends if i end it before resources run out and flushing the cache does not change anything either it seems.
thanks,
jim