Commit 65558fb2 authored by Yoni Fogel's avatar Yoni Fogel

[t:4963] Fix bug with open/closing lock tree in multiple threads

The previous fix added a new race condition; When the new race hits, we leak lock trees.

git-svn-id: file:///svn/toku/tokudb@44677 c7de825b-a66e-492c-adef-691d508d4ae1
parent a499ee93
...@@ -2157,7 +2157,7 @@ toku_lt_remove_ref(toku_lock_tree *tree) { ...@@ -2157,7 +2157,7 @@ toku_lt_remove_ref(toku_lock_tree *tree) {
// because toku_ltm_get_lt holds the mgr mutex and add/remove ref // because toku_ltm_get_lt holds the mgr mutex and add/remove ref
// holds the tree mutex. // holds the tree mutex.
assert(tree->ref_count > 0); assert(tree->ref_count > 0);
if (tree->ref_count == 1) { if (--tree->ref_count == 0) {
assert(tree->dict_id.dictid != DICTIONARY_ID_NONE.dictid); assert(tree->dict_id.dictid != DICTIONARY_ID_NONE.dictid);
ltm_stop_managing_lt_unlocked(tree->mgr, tree); ltm_stop_managing_lt_unlocked(tree->mgr, tree);
do_close = true; do_close = true;
......
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