Commit 0cb64094 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:3999] forgot to commit some extra test calls for the slow version of orthopush-flush

git-svn-id: file:///svn/toku/tokudb@35937 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6d55a7bc
...@@ -3141,7 +3141,6 @@ flush_some_child (BRT t, BRTNODE parent) ...@@ -3141,7 +3141,6 @@ flush_some_child (BRT t, BRTNODE parent)
fill_bfe_for_min_read(&bfe, t->h, t->db, t->compare_fun); fill_bfe_for_min_read(&bfe, t->h, t->db, t->compare_fun);
toku_pin_brtnode_off_client_thread(t, targetchild, childfullhash, &bfe, 1, &parent, &child); toku_pin_brtnode_off_client_thread(t, targetchild, childfullhash, &bfe, 1, &parent, &child);
// for test // for test
call_flusher_thread_callback(ft_flush_after_child_pin); call_flusher_thread_callback(ft_flush_after_child_pin);
...@@ -3183,7 +3182,6 @@ flush_some_child (BRT t, BRTNODE parent) ...@@ -3183,7 +3182,6 @@ flush_some_child (BRT t, BRTNODE parent)
bring_node_fully_into_memory(child, t); bring_node_fully_into_memory(child, t);
child->dirty = 1; child->dirty = 1;
// It is possible after reading in the entire child, // It is possible after reading in the entire child,
// that we now know that the child is not reactive // that we now know that the child is not reactive
// if so, we can unpin parent right now // if so, we can unpin parent right now
...@@ -3471,9 +3469,11 @@ static void flush_node_fun(void *fe_v) ...@@ -3471,9 +3469,11 @@ static void flush_node_fun(void *fe_v)
fe->node->dirty = 1; fe->node->dirty = 1;
if (fe->bnc) { if (fe->bnc) {
// In this case, we have a bnc to flush to a node
// for test purposes // for test purposes
call_flusher_thread_callback(ft_flush_before_applying_inbox); call_flusher_thread_callback(ft_flush_before_applying_inbox);
// In this case, we have a bnc to flush to a node
r = toku_bnc_flush_to_child(fe->brt, fe->bnc, fe->node); assert_zero(r); r = toku_bnc_flush_to_child(fe->brt, fe->bnc, fe->node); assert_zero(r);
destroy_nonleaf_childinfo(fe->bnc); destroy_nonleaf_childinfo(fe->bnc);
...@@ -3550,7 +3550,11 @@ flush_node_on_background_thread(BRT brt, BRTNODE parent) ...@@ -3550,7 +3550,11 @@ flush_node_on_background_thread(BRT brt, BRTNODE parent)
childfullhash, childfullhash,
&node_v &node_v
); );
if (r == 0) { if (r != 0) {
// In this case, we could not lock the child, so just place the parent on the background thread
place_node_and_bnc_on_background_thread(brt, parent, NULL);
}
else {
// //
// successfully locked child // successfully locked child
// //
...@@ -3573,17 +3577,15 @@ flush_node_on_background_thread(BRT brt, BRTNODE parent) ...@@ -3573,17 +3577,15 @@ flush_node_on_background_thread(BRT brt, BRTNODE parent)
// //
toku_unpin_brtnode(brt, parent); toku_unpin_brtnode(brt, parent);
place_node_and_bnc_on_background_thread(brt, child, bnc); place_node_and_bnc_on_background_thread(brt, child, bnc);
return;
} }
else { else {
// because the child may be reactive, we need to // because the child may be reactive, we need to
// put parent on background thread. // put parent on background thread.
// As a result, we unlock the child here. // As a result, we unlock the child here.
toku_unpin_brtnode(brt, child); toku_unpin_brtnode(brt, child);
place_node_and_bnc_on_background_thread(brt, parent, NULL);
} }
} }
// In this case, we could not lock the child, so just place the parent on the background thread
place_node_and_bnc_on_background_thread(brt, parent, NULL);
} }
int int
......
...@@ -1102,6 +1102,12 @@ test_main (int argc, const char *argv[]) { ...@@ -1102,6 +1102,12 @@ test_main (int argc, const char *argv[]) {
flush_to_leaf(t, true, false); flush_to_leaf(t, true, false);
flush_to_leaf(t, true, true); flush_to_leaf(t, true, true);
} }
for (int i = 0; i < 10; ++i) {
flush_to_leaf_with_keyrange(t, false);
flush_to_leaf_with_keyrange(t, true);
compare_apply_and_flush(t, false);
compare_apply_and_flush(t, true);
}
} }
r = toku_close_brt(t, 0); assert(r==0); r = toku_close_brt(t, 0); assert(r==0);
......
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