Commit 09cf4397 authored by Christian Rober's avatar Christian Rober Committed by Yoni Fogel

[t:4772] Checking in fix to main, preventing cleaner threads from incorrectly...

[t:4772] Checking in fix to main, preventing cleaner threads from incorrectly evicting recently basement nodes.

git-svn-id: file:///svn/toku/tokudb@42404 c7de825b-a66e-492c-adef-691d508d4ae1
parent db657df4
...@@ -148,7 +148,12 @@ update_flush_status(BRTNODE child, int cascades) { ...@@ -148,7 +148,12 @@ update_flush_status(BRTNODE child, int cascades) {
static void static void
maybe_destroy_child_blbs(BRTNODE node, BRTNODE child) maybe_destroy_child_blbs(BRTNODE node, BRTNODE child)
{ {
if (child->height == 0 && !child->dirty) { // If the node is already fully in memory, as in upgrade, we don't
// need to destroy the basement nodes because they are all equally
// up to date.
if (!is_entire_node_in_memory(child) &&
child->height == 0 &&
!child->dirty) {
for (int i = 0; i < child->n_children; ++i) { for (int i = 0; i < child->n_children; ++i) {
if (BP_STATE(child, i) == PT_AVAIL && if (BP_STATE(child, i) == PT_AVAIL &&
node->max_msn_applied_to_node_on_disk.msn < BLB_MAX_MSN_APPLIED(child, i).msn) { node->max_msn_applied_to_node_on_disk.msn < BLB_MAX_MSN_APPLIED(child, i).msn) {
......
...@@ -491,6 +491,7 @@ void destroy_basement_node (BASEMENTNODE bn); ...@@ -491,6 +491,7 @@ void destroy_basement_node (BASEMENTNODE bn);
void destroy_nonleaf_childinfo (NONLEAF_CHILDINFO nl); void destroy_nonleaf_childinfo (NONLEAF_CHILDINFO nl);
void toku_destroy_brtnode_internals(BRTNODE node); void toku_destroy_brtnode_internals(BRTNODE node);
void toku_brtnode_free (BRTNODE *node); void toku_brtnode_free (BRTNODE *node);
bool is_entire_node_in_memory(BRTNODE node);
void toku_assert_entire_node_in_memory(BRTNODE node); void toku_assert_entire_node_in_memory(BRTNODE node);
// FIXME needs toku prefix // FIXME needs toku prefix
void bring_node_fully_into_memory(BRTNODE node, struct brt_header* h); void bring_node_fully_into_memory(BRTNODE node, struct brt_header* h);
......
...@@ -227,7 +227,7 @@ toku_brt_header_suppress_rollbacks(struct brt_header *h, TOKUTXN txn) { ...@@ -227,7 +227,7 @@ toku_brt_header_suppress_rollbacks(struct brt_header *h, TOKUTXN txn) {
h->root_that_created_or_locked_when_empty = rootid; h->root_that_created_or_locked_when_empty = rootid;
} }
static bool is_entire_node_in_memory(BRTNODE node) { bool is_entire_node_in_memory(BRTNODE node) {
for (int i = 0; i < node->n_children; i++) { for (int i = 0; i < node->n_children; i++) {
if(BP_STATE(node,i) != PT_AVAIL) { if(BP_STATE(node,i) != PT_AVAIL) {
return false; return 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