Commit 0744a285 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4700], make fix

git-svn-id: file:///svn/toku/tokudb@41748 c7de825b-a66e-492c-adef-691d508d4ae1
parent 9762db25
...@@ -425,7 +425,9 @@ int toku_txn_commit_with_lsn(TOKUTXN txn, int nosync, YIELDF yield, void *yieldv ...@@ -425,7 +425,9 @@ int toku_txn_commit_with_lsn(TOKUTXN txn, int nosync, YIELDF yield, void *yieldv
bool release_multi_operation_client_lock) bool release_multi_operation_client_lock)
// Effect: Among other things: if release_multi_operation_client_lock is true, then unlock that lock (even if an error path is taken) // Effect: Among other things: if release_multi_operation_client_lock is true, then unlock that lock (even if an error path is taken)
{ {
BOOL txn_prepared = FALSE;
if (txn->state==TOKUTXN_PREPARING) { if (txn->state==TOKUTXN_PREPARING) {
txn_prepared = TRUE;
txn->state=TOKUTXN_LIVE; txn->state=TOKUTXN_LIVE;
invalidate_xa_xid(&txn->xa_xid); invalidate_xa_xid(&txn->xa_xid);
toku_list_remove(&txn->prepared_txns_link); toku_list_remove(&txn->prepared_txns_link);
...@@ -437,9 +439,16 @@ int toku_txn_commit_with_lsn(TOKUTXN txn, int nosync, YIELDF yield, void *yieldv ...@@ -437,9 +439,16 @@ int toku_txn_commit_with_lsn(TOKUTXN txn, int nosync, YIELDF yield, void *yieldv
int r; int r;
// panic handled in log_commit // panic handled in log_commit
// Child transactions do not actually 'commit'. They promote their changes to parent, so no need to fsync if this txn has a parent. // Child transactions do not actually 'commit'. They promote their
// the do_sync state is captured in the txn for txn_maybe_fsync_log function // changes to parent, so no need to fsync if this txn has a parent. The
txn->do_fsync = !txn->parent && (txn->force_fsync_on_commit || (!nosync && txn->num_rollentries>0)); // do_sync state is captured in the txn for txn_maybe_fsync_log function
// Additionally, if the transaction was first prepared, we do not need to
// fsync because the prepare caused an fsync of the log. In this case,
// we do not need an additional of the log. We rely on the client running
// recovery to properly recommit this transaction if the commit
// does not make it to disk. In the case of MySQL, that would be the
// binary log.
txn->do_fsync = !txn_prepared && !txn->parent && (txn->force_fsync_on_commit || (!nosync && txn->num_rollentries>0));
txn->progress_poll_fun = poll; txn->progress_poll_fun = poll;
txn->progress_poll_fun_extra = poll_extra; txn->progress_poll_fun_extra = poll_extra;
......
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