Commit 037ebcd3 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

refs #5393, make fix, still need to fix cachetable-simple-pin-cheap.cc

git-svn-id: file:///svn/toku/tokudb@47055 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6a354be9
...@@ -1454,35 +1454,9 @@ static bool try_pin_pair( ...@@ -1454,35 +1454,9 @@ static bool try_pin_pair(
ct->list.read_list_lock(); ct->list.read_list_lock();
} }
if (lock_type != PL_READ) {
ct->list.read_pending_cheap_lock();
bool p_checkpoint_pending = p->checkpoint_pending;
p->checkpoint_pending = false;
for (uint32_t i = 0; i < num_dependent_pairs; i++) {
dep_checkpoint_pending[i] = dependent_pairs[i]->checkpoint_pending;
dependent_pairs[i]->checkpoint_pending = false;
}
ct->list.read_pending_cheap_unlock();
checkpoint_pair_and_dependent_pairs(
ct,
p,
p_checkpoint_pending,
num_dependent_pairs,
dependent_pairs,
dep_checkpoint_pending,
dependent_dirty
);
}
bool partial_fetch_required = pf_req_callback(p->value_data,read_extraargs); bool partial_fetch_required = pf_req_callback(p->value_data,read_extraargs);
// shortcutting a path to getting the user the data
// helps scalability for in-memory workloads
if (!partial_fetch_required) {
try_again = false;
goto exit;
}
// at this point, a partial fetch is required if (partial_fetch_required) {
if (ct->ev.should_client_thread_sleep() && !already_slept) { if (ct->ev.should_client_thread_sleep() && !already_slept) {
pair_lock(p); pair_lock(p);
unpin_pair(p, (lock_type == PL_READ)); unpin_pair(p, (lock_type == PL_READ));
...@@ -1541,6 +1515,27 @@ static bool try_pin_pair( ...@@ -1541,6 +1515,27 @@ static bool try_pin_pair(
pair_unlock(p); pair_unlock(p);
} }
ct->list.read_list_lock(); ct->list.read_list_lock();
}
if (lock_type != PL_READ) {
ct->list.read_pending_cheap_lock();
bool p_checkpoint_pending = p->checkpoint_pending;
p->checkpoint_pending = false;
for (uint32_t i = 0; i < num_dependent_pairs; i++) {
dep_checkpoint_pending[i] = dependent_pairs[i]->checkpoint_pending;
dependent_pairs[i]->checkpoint_pending = false;
}
ct->list.read_pending_cheap_unlock();
checkpoint_pair_and_dependent_pairs(
ct,
p,
p_checkpoint_pending,
num_dependent_pairs,
dependent_pairs,
dep_checkpoint_pending,
dependent_dirty
);
}
try_again = false; try_again = false;
exit: exit:
...@@ -1731,16 +1726,6 @@ beginning: ...@@ -1731,16 +1726,6 @@ beginning:
p->value_rwlock.read_lock(); p->value_rwlock.read_lock();
pair_unlock(p); pair_unlock(p);
} }
// because we grabbed an expensive lock for the fetch,
// we ought to downgrade it back to cheap if we have to
// once we are done with the fetch
else if (lock_type == PL_WRITE_CHEAP) {
pair_lock(p);
p->value_rwlock.write_unlock();
p->value_rwlock.write_lock(false);
pair_unlock(p);
}
// We need to be holding the read list lock when we exit. // We need to be holding the read list lock when we exit.
// We grab it here because we released it earlier to // We grab it here because we released it earlier to
// grab the write list lock because the checkpointing and // grab the write list lock because the checkpointing and
......
...@@ -149,7 +149,7 @@ static void *move_numbers(void *arg) { ...@@ -149,7 +149,7 @@ static void *move_numbers(void *arg) {
&v1, &v1,
&s1, &s1,
wc, fetch, def_pf_req_callback, def_pf_callback, wc, fetch, def_pf_req_callback, def_pf_callback,
PL_WRITE_EXPENSIVE, PL_WRITE_CHEAP,
NULL, NULL,
0, //num_dependent_pairs 0, //num_dependent_pairs
NULL, NULL,
...@@ -171,7 +171,7 @@ static void *move_numbers(void *arg) { ...@@ -171,7 +171,7 @@ static void *move_numbers(void *arg) {
&v1, &v1,
&s1, &s1,
wc, fetch, def_pf_req_callback, def_pf_callback, wc, fetch, def_pf_req_callback, def_pf_callback,
PL_WRITE_EXPENSIVE, PL_WRITE_CHEAP,
NULL, NULL,
1, //num_dependent_pairs 1, //num_dependent_pairs
&f1, &f1,
...@@ -205,7 +205,7 @@ static void *move_numbers(void *arg) { ...@@ -205,7 +205,7 @@ static void *move_numbers(void *arg) {
&v1, &v1,
&s1, &s1,
wc, fetch, def_pf_req_callback, def_pf_callback, wc, fetch, def_pf_req_callback, def_pf_callback,
PL_WRITE_EXPENSIVE, PL_WRITE_CHEAP,
NULL, NULL,
1, //num_dependent_pairs 1, //num_dependent_pairs
&f1, &f1,
......
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