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

refs #6300, fix on main

git-svn-id: file:///svn/toku/tokudb@54569 c7de825b-a66e-492c-adef-691d508d4ae1
parent 90607a26
...@@ -1220,7 +1220,8 @@ maybe_merge_pinned_leaf_nodes( ...@@ -1220,7 +1220,8 @@ maybe_merge_pinned_leaf_nodes(
{ {
unsigned int sizea = toku_serialize_ftnode_size(a); unsigned int sizea = toku_serialize_ftnode_size(a);
unsigned int sizeb = toku_serialize_ftnode_size(b); unsigned int sizeb = toku_serialize_ftnode_size(b);
if ((sizea + sizeb)*4 > (nodesize*3)) { uint32_t num_leafentries = get_leaf_num_entries(a) + get_leaf_num_entries(b);
if (num_leafentries > 1 && (sizea + sizeb)*4 > (nodesize*3)) {
// the combined size is more than 3/4 of a node, so don't merge them. // the combined size is more than 3/4 of a node, so don't merge them.
*did_merge = false; *did_merge = false;
if (sizea*4 > nodesize && sizeb*4 > nodesize) { if (sizea*4 > nodesize && sizeb*4 > nodesize) {
......
...@@ -155,6 +155,7 @@ bool toku_ft_nonleaf_is_gorged(FTNODE node, uint32_t nodesize); ...@@ -155,6 +155,7 @@ bool toku_ft_nonleaf_is_gorged(FTNODE node, uint32_t nodesize);
enum reactivity get_nonleaf_reactivity (FTNODE node); enum reactivity get_nonleaf_reactivity (FTNODE node);
enum reactivity get_node_reactivity (FTNODE node, uint32_t nodesize); enum reactivity get_node_reactivity (FTNODE node, uint32_t nodesize);
uint32_t get_leaf_num_entries(FTNODE node);
// data of an available partition of a leaf ftnode // data of an available partition of a leaf ftnode
......
...@@ -315,7 +315,7 @@ toku_assert_entire_node_in_memory(FTNODE UU() node) { ...@@ -315,7 +315,7 @@ toku_assert_entire_node_in_memory(FTNODE UU() node) {
paranoid_invariant(is_entire_node_in_memory(node)); paranoid_invariant(is_entire_node_in_memory(node));
} }
static uint32_t uint32_t
get_leaf_num_entries(FTNODE node) { get_leaf_num_entries(FTNODE node) {
uint32_t result = 0; uint32_t result = 0;
int i; int i;
......
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