Commit 87e8e6a0 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 11c03de9
...@@ -60,7 +60,7 @@ toku_db_construct_autotxn(DB* db, DB_TXN **txn, BOOL* changed, BOOL force_auto_c ...@@ -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)); 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); 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; if (r!=0) return r;
*changed = TRUE; *changed = TRUE;
return 0; return 0;
...@@ -69,14 +69,12 @@ toku_db_construct_autotxn(DB* db, DB_TXN **txn, BOOL* changed, BOOL force_auto_c ...@@ -69,14 +69,12 @@ toku_db_construct_autotxn(DB* db, DB_TXN **txn, BOOL* changed, BOOL force_auto_c
static inline int static inline int
toku_db_destruct_autotxn(DB_TXN *txn, int r, BOOL changed) { toku_db_destruct_autotxn(DB_TXN *txn, int r, BOOL changed) {
if (!changed) return r; if (!changed) return r;
toku_ydb_lock();
if (r==0) { if (r==0) {
r = toku_txn_commit(txn, 0, NULL, NULL, false); r = locked_txn_commit(txn, 0);
} }
else { else {
toku_txn_abort(txn, NULL, NULL, false); locked_txn_abort(txn);
} }
toku_ydb_unlock();
return r; 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