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

[t:4373], write down an important invariant in a comment

git-svn-id: file:///svn/toku/tokudb@38617 c7de825b-a66e-492c-adef-691d508d4ae1
parent 580b964e
...@@ -4561,13 +4561,15 @@ maybe_apply_ancestors_messages_to_node (BRT t, BRTNODE node, ANCESTORS ancestors ...@@ -4561,13 +4561,15 @@ maybe_apply_ancestors_messages_to_node (BRT t, BRTNODE node, ANCESTORS ancestors
// Bring a leaf node up-to-date according to all the messages in the ancestors. // Bring a leaf node up-to-date according to all the messages in the ancestors.
// If the leaf node is already up-to-date then do nothing. // If the leaf node is already up-to-date then do nothing.
// If the leaf node is not already up-to-date, then record the work done for that leaf in each ancestor. // If the leaf node is not already up-to-date, then record the work done for that leaf in each ancestor.
// If workdone for any nonleaf nodes exceeds threshold then flush them, but don't do any merges or splits.
{ {
VERIFY_NODE(t, node); VERIFY_NODE(t, node);
if (node->height > 0) { goto exit; } if (node->height > 0) { goto exit; }
// know we are a leaf node // know we are a leaf node
// need to apply messages to each basement node // An important invariant:
// TODO: (Zardosht) cilkify this // We MUST bring every available basement node up to date.
// flushing on the cleaner thread depends on this. This invariant
// allows the cleaner thread to just pick an internal node and flush it
// as opposed to being forced to start from the root.
for (int i = 0; i < node->n_children; i++) { for (int i = 0; i < node->n_children; i++) {
int height = 0; int height = 0;
if (BP_STATE(node, i) != PT_AVAIL) { continue; } if (BP_STATE(node, i) != PT_AVAIL) { continue; }
......
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