Commit 32ebfca6 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4793], add a test

git-svn-id: file:///svn/toku/tokudb@42600 c7de825b-a66e-492c-adef-691d508d4ae1
parent cf28e8ea
...@@ -41,7 +41,7 @@ static int update_func( ...@@ -41,7 +41,7 @@ static int update_func(
static void static void
doit (void) { doit (BOOL keep_other_bn_in_memory) {
BLOCKNUM node_leaf; BLOCKNUM node_leaf;
BLOCKNUM node_internal, node_root; BLOCKNUM node_internal, node_root;
...@@ -195,13 +195,25 @@ doit (void) { ...@@ -195,13 +195,25 @@ doit (void) {
r = toku_brt_lookup(brt, toku_fill_dbt(&k, "a", 2), lookup_checkf, &pair); r = toku_brt_lookup(brt, toku_fill_dbt(&k, "a", 2), lookup_checkf, &pair);
assert(r==0); assert(r==0);
// if (keep_other_bn_in_memory) {
// pin the leaf one more time //
// and make sure that one basement // pin the leaf one more time
// node is in memory and another is // and make sure that one basement
// on disk // both basement nodes are in memory,
// // but only one should have broadcast message
fill_bfe_for_min_read(&bfe, brt->h); // applied.
//
fill_bfe_for_full_read(&bfe, brt->h);
}
else {
//
// pin the leaf one more time
// and make sure that one basement
// node is in memory and another is
// on disk
//
fill_bfe_for_min_read(&bfe, brt->h);
}
toku_pin_brtnode_off_client_thread( toku_pin_brtnode_off_client_thread(
brt->h, brt->h,
node_leaf, node_leaf,
...@@ -215,7 +227,12 @@ doit (void) { ...@@ -215,7 +227,12 @@ doit (void) {
assert(!node->dirty); assert(!node->dirty);
assert(node->n_children == 2); assert(node->n_children == 2);
assert(BP_STATE(node,0) == PT_AVAIL); assert(BP_STATE(node,0) == PT_AVAIL);
assert(BP_STATE(node,1) == PT_ON_DISK); if (keep_other_bn_in_memory) {
assert(BP_STATE(node,1) == PT_AVAIL);
}
else {
assert(BP_STATE(node,1) == PT_ON_DISK);
}
toku_unpin_brtnode_off_client_thread(brt->h, node); toku_unpin_brtnode_off_client_thread(brt->h, node);
// //
...@@ -285,6 +302,7 @@ doit (void) { ...@@ -285,6 +302,7 @@ doit (void) {
int int
test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute__((__unused__))) { test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute__((__unused__))) {
default_parse_args(argc, argv); default_parse_args(argc, argv);
doit(); doit(FALSE);
doit(TRUE);
return 0; 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