Commit 5293ee33 authored by Christian Rober's avatar Christian Rober Committed by Yoni Fogel
Browse files

[t:4468] Transaction yiled frequency changes merged to main.

git-svn-id: file:///svn/toku/tokudb@40190 c7de825b-a66e-492c-adef-691d508d4ae1
parent b98ee3a1
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -113,7 +113,15 @@ toku_apply_txn (TOKUTXN txn, YIELDF yield, void*yieldv, LSN lsn,
                r = func(txn, item, yield, yieldv, lsn);
                if (r!=0) return r;
                count++;
                if (count%2 == 0) yield(NULL, NULL, yieldv);
                // We occassionally yield here to prevent transactions
                // from hogging the log.  This yield will allow other
                // threads to grab the ydb lock.  However, we don't
                // want any transaction doing more than one log
                // operation to always yield the ydb lock, as it must
                // wait for the ydb lock to be released to proceed.
                if (count % 8 == 0) {
                    yield(NULL, NULL, yieldv);
                }
            }
        }
        if (next_log.b == txn->spilled_rollback_head.b) {