Commit 04d853de authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4928], use locked_txn_XXX functions in autotxn functions

git-svn-id: file:///svn/toku/tokudb@43897 c7de825b-a66e-492c-adef-691d508d4ae1
parent f2c4fe13
......@@ -60,7 +60,7 @@ toku_db_construct_autotxn(DB* db, DB_TXN **txn, BOOL* changed, BOOL force_auto_c
}
BOOL nosync = (BOOL)(!force_auto_commit && !(env->i->open_flags & DB_AUTO_COMMIT));
u_int32_t txn_flags = DB_TXN_NOWAIT | (nosync ? DB_TXN_NOSYNC : 0);
int r = toku_txn_begin(env, NULL, txn, txn_flags, 1, FALSE);
int r = locked_txn_begin(env, NULL, txn, txn_flags);
if (r!=0) return r;
*changed = TRUE;
return 0;
......@@ -69,14 +69,12 @@ toku_db_construct_autotxn(DB* db, DB_TXN **txn, BOOL* changed, BOOL force_auto_c
static inline int
toku_db_destruct_autotxn(DB_TXN *txn, int r, BOOL changed) {
if (!changed) return r;
toku_ydb_lock();
if (r==0) {
r = toku_txn_commit(txn, 0, NULL, NULL, false);
r = locked_txn_commit(txn, 0);
}
else {
toku_txn_abort(txn, NULL, NULL, false);
locked_txn_abort(txn);
}
toku_ydb_unlock();
return r;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment