Commit 2fbdd66b authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4097], add comment explaining why we take the ydb lock around a line of code

git-svn-id: file:///svn/toku/tokudb@37980 c7de825b-a66e-492c-adef-691d508d4ae1
parent f3967679
...@@ -2892,6 +2892,11 @@ locked_txn_commit_with_progress(DB_TXN *txn, u_int32_t flags, ...@@ -2892,6 +2892,11 @@ locked_txn_commit_with_progress(DB_TXN *txn, u_int32_t flags,
// will grab the multi operation lock, and then not be able to complete the checkpoint because // will grab the multi operation lock, and then not be able to complete the checkpoint because
// this thread has its rollback log pinned and is trying to grab the multi operation lock. // this thread has its rollback log pinned and is trying to grab the multi operation lock.
// //
// We grab the ydb lock because the checkpoint thread also unpins inprogress rollback logs,
// so the ydb lock protects a race of both this thread and the checkpoint thread unpinning the
// inprogress rollback log. If we want, we can probably have the checkpoint thread to not
// unpin inprogress rollback logs, making this ydb lock grab unnecessary.
//
toku_ydb_lock(); toku_ydb_lock();
int r = toku_unpin_inprogress_rollback_log(ttxn); int r = toku_unpin_inprogress_rollback_log(ttxn);
toku_ydb_unlock(); toku_ydb_unlock();
......
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