Commit d506b24c authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:4741] fix more tests that need to call toku_brtnode_pe_callback with a valid header

git-svn-id: file:///svn/toku/tokudb@43557 c7de825b-a66e-492c-adef-691d508d4ae1
parent 0c9a2a2e
......@@ -61,7 +61,7 @@ test_prefetch_read(int fd, BRT UU(brt), struct brt_header *brt_h) {
assert(BP_STATE(dn,0) == PT_AVAIL);
assert(BP_STATE(dn,1) == PT_AVAIL);
assert(BP_STATE(dn,2) == PT_AVAIL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_COMPRESSED);
assert(BP_STATE(dn,1) == PT_COMPRESSED);
assert(BP_STATE(dn,2) == PT_COMPRESSED);
......@@ -83,7 +83,7 @@ test_prefetch_read(int fd, BRT UU(brt), struct brt_header *brt_h) {
assert(BP_STATE(dn,0) == PT_ON_DISK);
assert(BP_STATE(dn,1) == PT_AVAIL);
assert(BP_STATE(dn,2) == PT_AVAIL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_ON_DISK);
assert(BP_STATE(dn,1) == PT_COMPRESSED);
assert(BP_STATE(dn,2) == PT_COMPRESSED);
......@@ -105,7 +105,7 @@ test_prefetch_read(int fd, BRT UU(brt), struct brt_header *brt_h) {
assert(BP_STATE(dn,0) == PT_ON_DISK);
assert(BP_STATE(dn,1) == PT_AVAIL);
assert(BP_STATE(dn,2) == PT_ON_DISK);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_ON_DISK);
assert(BP_STATE(dn,1) == PT_COMPRESSED);
assert(BP_STATE(dn,2) == PT_ON_DISK);
......@@ -126,7 +126,7 @@ test_prefetch_read(int fd, BRT UU(brt), struct brt_header *brt_h) {
assert(BP_STATE(dn,0) == PT_ON_DISK);
assert(BP_STATE(dn,1) == PT_ON_DISK);
assert(BP_STATE(dn,2) == PT_AVAIL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_ON_DISK);
assert(BP_STATE(dn,1) == PT_ON_DISK);
assert(BP_STATE(dn,2) == PT_COMPRESSED);
......@@ -147,7 +147,7 @@ test_prefetch_read(int fd, BRT UU(brt), struct brt_header *brt_h) {
assert(BP_STATE(dn,0) == PT_AVAIL);
assert(BP_STATE(dn,1) == PT_ON_DISK);
assert(BP_STATE(dn,2) == PT_ON_DISK);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_COMPRESSED);
assert(BP_STATE(dn,1) == PT_ON_DISK);
assert(BP_STATE(dn,2) == PT_ON_DISK);
......@@ -206,11 +206,11 @@ test_subset_read(int fd, BRT UU(brt), struct brt_header *brt_h) {
assert(BP_STATE(dn,1) == PT_ON_DISK);
assert(BP_STATE(dn,2) == PT_AVAIL);
// need to call this twice because we had a subset read before, that touched the clock
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_ON_DISK);
assert(BP_STATE(dn,1) == PT_ON_DISK);
assert(BP_STATE(dn,2) == PT_AVAIL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_ON_DISK);
assert(BP_STATE(dn,1) == PT_ON_DISK);
assert(BP_STATE(dn,2) == PT_COMPRESSED);
......@@ -231,11 +231,11 @@ test_subset_read(int fd, BRT UU(brt), struct brt_header *brt_h) {
assert(BP_STATE(dn,1) == PT_AVAIL);
assert(BP_STATE(dn,2) == PT_AVAIL);
// need to call this twice because we had a subset read before, that touched the clock
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_ON_DISK);
assert(BP_STATE(dn,1) == PT_COMPRESSED);
assert(BP_STATE(dn,2) == PT_AVAIL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_ON_DISK);
assert(BP_STATE(dn,1) == PT_COMPRESSED);
assert(BP_STATE(dn,2) == PT_COMPRESSED);
......@@ -255,11 +255,11 @@ test_subset_read(int fd, BRT UU(brt), struct brt_header *brt_h) {
assert(BP_STATE(dn,1) == PT_AVAIL);
assert(BP_STATE(dn,2) == PT_ON_DISK);
// need to call this twice because we had a subset read before, that touched the clock
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_AVAIL);
assert(BP_STATE(dn,1) == PT_COMPRESSED);
assert(BP_STATE(dn,2) == PT_ON_DISK);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(dn, make_pair_attr(0xffffffff), &attr, brt_h);
assert(BP_STATE(dn,0) == PT_COMPRESSED);
assert(BP_STATE(dn,1) == PT_COMPRESSED);
assert(BP_STATE(dn,2) == PT_ON_DISK);
......
......@@ -124,7 +124,7 @@ setup_dn(enum brtnode_verify_type bft, int fd, struct brt_header *brt_h, BRTNODE
if (bft == read_none) {
if ((*dn)->height == 0) {
PAIR_ATTR attr;
toku_brtnode_pe_callback(*dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(*dn, make_pair_attr(0xffffffff), &attr, brt_h);
// assert all bp's are on disk
for (int i = 0; i < (*dn)->n_children; i++) {
if ((*dn)->height == 0) {
......@@ -149,14 +149,14 @@ setup_dn(enum brtnode_verify_type bft, int fd, struct brt_header *brt_h, BRTNODE
for (int i = 0; i < (*dn)->n_children; i++) {
assert(BP_STATE(*dn,i) == PT_AVAIL);
}
toku_brtnode_pe_callback(*dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(*dn, make_pair_attr(0xffffffff), &attr, brt_h);
for (int i = 0; i < (*dn)->n_children; i++) {
// assert all bp's are still available, because we touched the clock
assert(BP_STATE(*dn,i) == PT_AVAIL);
// now assert all should be evicted
assert(BP_SHOULD_EVICT(*dn, i));
}
toku_brtnode_pe_callback(*dn, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(*dn, make_pair_attr(0xffffffff), &attr, brt_h);
for (int i = 0; i < (*dn)->n_children; i++) {
assert(BP_STATE(*dn,i) == PT_COMPRESSED);
}
......
......@@ -285,7 +285,7 @@ doit (void) {
toku_pin_node_with_min_bfe(&node, node_internal, t);
for (int i = 0; i < 20; i++) {
PAIR_ATTR attr;
toku_brtnode_pe_callback(node, make_pair_attr(0xffffffff), &attr, NULL);
toku_brtnode_pe_callback(node, make_pair_attr(0xffffffff), &attr, t->h);
}
assert(BP_STATE(node,0) == PT_COMPRESSED);
toku_unpin_brtnode(t->h, 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