Commit 551f369b authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:3884] fix a problem with my change to brtleaf_split, and attempt to free...

[t:3884] fix a problem with my change to brtleaf_split, and attempt to free everything at the end of test3884. can't close cachetable now so valgrind is off for test3884

git-svn-id: file:///svn/toku/tokudb@34128 c7de825b-a66e-492c-adef-691d508d4ae1
parent 34abc6f4
......@@ -1344,9 +1344,8 @@ brtleaf_split (BRT t, BRTNODE node, BRTNODE *nodea, BRTNODE *nodeb, DBT *splitk,
subtract_estimates(&BP_SUBTREE_EST(node,curr_src_bn_index), &se_diff);
add_estimates(&BP_SUBTREE_EST(B,curr_dest_bn_index), &se_diff);
curr_dest_bn_index++;
} else {
curr_src_bn_index++;
}
curr_src_bn_index++;
// move the rest of the basement nodes
for ( ; curr_src_bn_index < node->n_children; curr_src_bn_index++, curr_dest_bn_index++) {
......
......@@ -159,6 +159,10 @@ check_brtloader-test-writer-errors-4: brtloader-test-writer-errors$(BINSUF)
check_brt-serialize-benchmark: brt-serialize-benchmark$(BINSUF)
./$< 92 200000
# test3884 doesn't work with valgrind yet, I need to resolve this
check_test3884: test3884$(BINSUF)
./$<
check_%: % $(PTHREAD_LOCAL)
$(VGRIND) ./$< $(VERBVERBOSE) $(EXTRA_ARGS) $(SUMMARIZE_CMD)
......
......@@ -94,9 +94,10 @@ test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute_
}
}
unlink(fname);
CACHETABLE ct;
r = toku_brt_create_cachetable(&ct, 0, ZERO_LSN, NULL_LOGGER); assert(r==0);
BRT brt;
r = toku_brt_create_cachetable(&ct, 0, ZERO_LSN, NULL_LOGGER); assert(r==0);
r = toku_open_brt(fname, 1, &brt, nodesize, bnsize, ct, null_txn, toku_builtin_compare_fun, null_db); assert(r==0);
BRTNODE nodea, nodeb;
......@@ -104,5 +105,26 @@ test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute_
// if we haven't done it right, we should hit the assert in the top of move_leafentries
brtleaf_split(brt, &sn, &nodea, &nodeb, &splitk, TRUE);
// r = toku_close_brt(brt, NULL); assert(r == 0);
// r = toku_cachetable_close(&ct); assert(r == 0);
if (splitk.data) {
toku_free(splitk.data);
}
toku_brtnode_free(&nodeb);
for (int i = 0; i < sn.n_children - 1; ++i) {
kv_pair_free(sn.childkeys[i]);
}
for (int i = 0; i < nelts / 2; ++i) {
toku_free(elts[i]);
}
for (int i = 0; i < sn.n_children; ++i) {
destroy_basement_node(BLB(&sn, i));
}
toku_free(sn.bp);
toku_free(sn.childkeys);
return 0;
}
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