Commit b93d3411 authored by Yoni Fogel's avatar Yoni Fogel

[t:2506] [t:2507] Fix bug in toku_cachetable_unpin_and_remove

write_pair_for_checkpoint now uses completion queue if set

git-svn-id: file:///svn/toku/tokudb@19187 c7de825b-a66e-492c-adef-691d508d4ae1
parent ea9e7afa
...@@ -1339,7 +1339,7 @@ static PAIR write_for_checkpoint_pair = NULL; ...@@ -1339,7 +1339,7 @@ static PAIR write_for_checkpoint_pair = NULL;
// On exit: the node is written out // On exit: the node is written out
// Method: take write lock // Method: take write lock
// if still pending write out the node // if still pending write out the node
// release the write lock. // if p->cq, put on completion queue. Else release write lock
static void static void
write_pair_for_checkpoint (CACHETABLE ct, PAIR p) write_pair_for_checkpoint (CACHETABLE ct, PAIR p)
{ {
...@@ -1358,9 +1358,10 @@ write_pair_for_checkpoint (CACHETABLE ct, PAIR p) ...@@ -1358,9 +1358,10 @@ write_pair_for_checkpoint (CACHETABLE ct, PAIR p)
p->remove_me = FALSE; p->remove_me = FALSE;
cachetable_write_pair(ct, p); // releases the write lock on the pair cachetable_write_pair(ct, p); // releases the write lock on the pair
} }
else { else if (p->cq)
workqueue_enq(p->cq, &p->asyncwork, 1);
else
rwlock_write_unlock(&p->rwlock); // didn't call cachetable_write_pair so we have to unlock it ourselves. rwlock_write_unlock(&p->rwlock); // didn't call cachetable_write_pair so we have to unlock it ourselves.
}
write_for_checkpoint_pair = NULL; write_for_checkpoint_pair = NULL;
} }
......
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