Commit a07e05a1 authored by Christian Rober's avatar Christian Rober Committed by Yoni Fogel

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

git-svn-id: file:///svn/toku/tokudb@40190 c7de825b-a66e-492c-adef-691d508d4ae1
parent 64b8d0d6
......@@ -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) {
......
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