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

[t:3653], have keyrange_internal not decompress any partitions

git-svn-id: file:///svn/toku/tokudb@32978 c7de825b-a66e-492c-adef-691d508d4ae1
parent e976e235
...@@ -6227,8 +6227,7 @@ static void toku_brt_keyrange_internal (BRT brt, CACHEKEY nodename, ...@@ -6227,8 +6227,7 @@ static void toku_brt_keyrange_internal (BRT brt, CACHEKEY nodename,
{ {
//assert(fullhash == toku_cachetable_hash(brt->cf, nodename)); //assert(fullhash == toku_cachetable_hash(brt->cf, nodename));
struct brtnode_fetch_extra bfe; struct brtnode_fetch_extra bfe;
// TODO: (Zardosht) change this fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_full_read(&bfe, brt->h);
toku_pin_brtnode_holding_lock(brt, nodename, fullhash, toku_pin_brtnode_holding_lock(brt, nodename, fullhash,
ancestors, bounds, &bfe, ancestors, bounds, &bfe,
&node); &node);
...@@ -6265,6 +6264,7 @@ static void toku_brt_keyrange_internal (BRT brt, CACHEKEY nodename, ...@@ -6265,6 +6264,7 @@ static void toku_brt_keyrange_internal (BRT brt, CACHEKEY nodename,
&next_ancestors, &next_bounds); &next_ancestors, &next_bounds);
} }
else { else {
if (BP_STATE(node,i) == PT_AVAIL) {
struct cmd_leafval_heaviside_extra be = {brt, key}; struct cmd_leafval_heaviside_extra be = {brt, key};
u_int32_t idx; u_int32_t idx;
int r = toku_omt_find_zero(BLB_BUFFER(node, i), toku_cmd_leafval_heaviside, &be, 0, &idx, NULL); int r = toku_omt_find_zero(BLB_BUFFER(node, i), toku_cmd_leafval_heaviside, &be, 0, &idx, NULL);
...@@ -6275,6 +6275,15 @@ static void toku_brt_keyrange_internal (BRT brt, CACHEKEY nodename, ...@@ -6275,6 +6275,15 @@ static void toku_brt_keyrange_internal (BRT brt, CACHEKEY nodename,
(*equal)++; (*equal)++;
} }
} }
else {
// In this case, we need to search the basement node, but it is not available
// We do not want to incur a disk seek just to get an estimate, so, we
// just take a guess. Arbitrarily say half the elements are less, and half are greater
u_int64_t bn_subest = BP_SUBTREE_EST(node,i).ndata;
*less += bn_subest/2;
*greater += bn_subest - (bn_subest/2);
}
}
} }
} }
toku_unpin_brtnode(brt, node); toku_unpin_brtnode(brt, node);
......
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