Commit ce0a76d6 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:3925], make change per discussion with engineers

git-svn-id: file:///svn/toku/tokudb@37948 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6288f066
...@@ -2411,6 +2411,14 @@ int toku_cachetable_get_and_pin_nonblocking ( ...@@ -2411,6 +2411,14 @@ int toku_cachetable_get_and_pin_nonblocking (
{ {
CACHETABLE ct = cf->cachetable; CACHETABLE ct = cf->cachetable;
cachetable_lock(ct); cachetable_lock(ct);
//
// Even though there is a risk that cachetable_wait_write may wait on a bunch
// of I/O to complete, we call this with the ydb lock held, because if we
// are in this situation where a lot of data is being evicted on writer threads
// then we are in a screw case anyway, so it should be ok to hold the ydb lock,
// until a bunch of data is written out.
//
cachetable_wait_write(ct);
int count = 0; int count = 0;
PAIR p; PAIR p;
for (p = ct->table[fullhash&(ct->table_size-1)]; p; p = p->hash_chain) { for (p = ct->table[fullhash&(ct->table_size-1)]; p; p = p->hash_chain) {
......
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