Commit 3c0a9bce authored by John Esmet's avatar John Esmet

refs #145 capture the node's height before calling finalize(), which is

the last point we may read the node variable safely.
parent 3fe7781a
...@@ -1206,6 +1206,7 @@ int toku_ftnode_pe_callback(void *ftnode_pv, PAIR_ATTR old_attr, void *write_ext ...@@ -1206,6 +1206,7 @@ int toku_ftnode_pe_callback(void *ftnode_pv, PAIR_ATTR old_attr, void *write_ext
exit: exit:
// call the finalize callback with a new pair attr // call the finalize callback with a new pair attr
int height = node->height;
PAIR_ATTR new_attr = make_ftnode_pair_attr(node); PAIR_ATTR new_attr = make_ftnode_pair_attr(node);
finalize(new_attr, finalize_extra); finalize(new_attr, finalize_extra);
...@@ -1222,7 +1223,7 @@ int toku_ftnode_pe_callback(void *ftnode_pv, PAIR_ATTR old_attr, void *write_ext ...@@ -1222,7 +1223,7 @@ int toku_ftnode_pe_callback(void *ftnode_pv, PAIR_ATTR old_attr, void *write_ext
} }
// stats // stats
if (num_partial_evictions > 0) { if (num_partial_evictions > 0) {
if (node->height == 0) { if (height == 0) {
long delta = old_attr.leaf_size - new_attr.leaf_size; long delta = old_attr.leaf_size - new_attr.leaf_size;
STATUS_INC(FT_PARTIAL_EVICTIONS_LEAF, num_partial_evictions); STATUS_INC(FT_PARTIAL_EVICTIONS_LEAF, num_partial_evictions);
STATUS_INC(FT_PARTIAL_EVICTIONS_LEAF_BYTES, delta); STATUS_INC(FT_PARTIAL_EVICTIONS_LEAF_BYTES, delta);
......
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