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

[t:3641], merge 32487 to main, consolidating work before starting on...

[t:3641], merge 32487 to main, consolidating work before starting on cachetable fixes in tokudb.3627

git-svn-id: file:///svn/toku/tokudb@32488 c7de825b-a66e-492c-adef-691d508d4ae1
parent 527eeb1f
...@@ -2514,6 +2514,10 @@ brtnode_nonleaf_put_cmd_at_root (BRT t, BRTNODE node, BRT_MSG cmd) ...@@ -2514,6 +2514,10 @@ brtnode_nonleaf_put_cmd_at_root (BRT t, BRTNODE node, BRT_MSG cmd)
brt_nonleaf_put_cmd(t, node, cmd); brt_nonleaf_put_cmd(t, node, cmd);
} }
// Effect: applies the cmd to the leaf if the appropriate basement node is in memory.
// If the appropriate basement node is not in memory, then nothing gets applied
// If the appropriate basement node must be in memory, it is the caller's responsibility to ensure
// that it is
void toku_apply_cmd_to_leaf(BRT t, BRTNODE node, BRT_MSG cmd, int *made_change) { void toku_apply_cmd_to_leaf(BRT t, BRTNODE node, BRT_MSG cmd, int *made_change) {
VERIFY_NODE(t, node); VERIFY_NODE(t, node);
// ignore messages that have already been applied to this leaf // ignore messages that have already been applied to this leaf
...@@ -2527,6 +2531,7 @@ void toku_apply_cmd_to_leaf(BRT t, BRTNODE node, BRT_MSG cmd, int *made_change) ...@@ -2527,6 +2531,7 @@ void toku_apply_cmd_to_leaf(BRT t, BRTNODE node, BRT_MSG cmd, int *made_change)
if (brt_msg_applies_once(cmd)) { if (brt_msg_applies_once(cmd)) {
unsigned int childnum = toku_brtnode_which_child(node, cmd->u.id.key, t); unsigned int childnum = toku_brtnode_which_child(node, cmd->u.id.key, t);
if (BP_STATE(node,childnum) == PT_AVAIL) {
brt_leaf_put_cmd( brt_leaf_put_cmd(
t, t,
(BASEMENTNODE)node->bp[childnum].ptr, (BASEMENTNODE)node->bp[childnum].ptr,
...@@ -2535,9 +2540,11 @@ void toku_apply_cmd_to_leaf(BRT t, BRTNODE node, BRT_MSG cmd, int *made_change) ...@@ -2535,9 +2540,11 @@ void toku_apply_cmd_to_leaf(BRT t, BRTNODE node, BRT_MSG cmd, int *made_change)
made_change made_change
); );
} }
}
else if (brt_msg_applies_all(cmd)) { else if (brt_msg_applies_all(cmd)) {
int bn_made_change = 0; int bn_made_change = 0;
for (int childnum=0; childnum<node->n_children; childnum++) { for (int childnum=0; childnum<node->n_children; childnum++) {
if (BP_STATE(node,childnum) == PT_AVAIL) {
brt_leaf_put_cmd( brt_leaf_put_cmd(
t, t,
(BASEMENTNODE)node->bp[childnum].ptr, (BASEMENTNODE)node->bp[childnum].ptr,
...@@ -2548,6 +2555,7 @@ void toku_apply_cmd_to_leaf(BRT t, BRTNODE node, BRT_MSG cmd, int *made_change) ...@@ -2548,6 +2555,7 @@ void toku_apply_cmd_to_leaf(BRT t, BRTNODE node, BRT_MSG cmd, int *made_change)
if (bn_made_change) *made_change = 1; if (bn_made_change) *made_change = 1;
} }
} }
}
else if (!brt_msg_does_nothing(cmd)) { else if (!brt_msg_does_nothing(cmd)) {
assert(FALSE); assert(FALSE);
} }
......
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