Commit 1fbb0cca authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:3982] #3982 Remove field optimized_for_upgrade from basement.

git-svn-id: file:///svn/toku/tokudb@35851 c7de825b-a66e-492c-adef-691d508d4ae1
parent 60b59275
...@@ -415,7 +415,6 @@ static inline void set_BSB(BRTNODE node, int i, SUB_BLOCK sb) { ...@@ -415,7 +415,6 @@ static inline void set_BSB(BRTNODE node, int i, SUB_BLOCK sb) {
} }
// brtnode leaf basementnode macros, // brtnode leaf basementnode macros,
#define BLB_OPTIMIZEDFORUPGRADE(node,i) (BLB(node,i)->optimized_for_upgrade)
#define BLB_MAX_MSN_APPLIED(node,i) (BLB(node,i)->max_msn_applied) #define BLB_MAX_MSN_APPLIED(node,i) (BLB(node,i)->max_msn_applied)
#define BLB_MAX_DSN_APPLIED(node,i) (BLB(node,i)->max_dsn_applied) #define BLB_MAX_DSN_APPLIED(node,i) (BLB(node,i)->max_dsn_applied)
#define BLB_BUFFER(node,i) (BLB(node,i)->buffer) #define BLB_BUFFER(node,i) (BLB(node,i)->buffer)
......
...@@ -250,7 +250,6 @@ serialize_brtnode_partition_size (BRTNODE node, int i) ...@@ -250,7 +250,6 @@ serialize_brtnode_partition_size (BRTNODE node, int i)
} }
else { else {
result += 4; // n_entries in buffer table result += 4; // n_entries in buffer table
result += 4; // optimized_for_upgrade, see if we can get rid of this
result += BLB_NBYTESINBUF(node, i); result += BLB_NBYTESINBUF(node, i);
} }
result += 4; // checksum result += 4; // checksum
...@@ -303,8 +302,6 @@ serialize_brtnode_partition(BRTNODE node, int i, struct sub_block *sb) { ...@@ -303,8 +302,6 @@ serialize_brtnode_partition(BRTNODE node, int i, struct sub_block *sb) {
else { else {
unsigned char ch = BRTNODE_PARTITION_OMT_LEAVES; unsigned char ch = BRTNODE_PARTITION_OMT_LEAVES;
wbuf_nocrc_char(&wb, ch); wbuf_nocrc_char(&wb, ch);
wbuf_nocrc_int(&wb, BLB_OPTIMIZEDFORUPGRADE(node, i));
wbuf_nocrc_uint(&wb, toku_omt_size(BLB_BUFFER(node, i))); wbuf_nocrc_uint(&wb, toku_omt_size(BLB_BUFFER(node, i)));
// //
...@@ -531,10 +528,9 @@ rebalance_brtnode_leaf(BRTNODE node, unsigned int basementnodesize) ...@@ -531,10 +528,9 @@ rebalance_brtnode_leaf(BRTNODE node, unsigned int basementnodesize)
// now we need to fill in the new basement nodes and pivots // now we need to fill in the new basement nodes and pivots
// TODO: (Zardosht) this is an ugly thing right now // TODO: (Zardosht) this is an ugly thing right now
// Need to figure out how to properly deal with the values seqinsert // Need to figure out how to properly deal with seqinsert.
// and optimized_for_upgrade. I am not happy with how this is being // I am not happy with how this is being
// handled with basement nodes // handled with basement nodes
u_int32_t tmp_optimized_for_upgrade = BLB_OPTIMIZEDFORUPGRADE(node, node->n_children-1);
u_int32_t tmp_seqinsert = BLB_SEQINSERT(node, node->n_children-1); u_int32_t tmp_seqinsert = BLB_SEQINSERT(node, node->n_children-1);
MSN max_msn = MIN_MSN; MSN max_msn = MIN_MSN;
...@@ -574,9 +570,8 @@ rebalance_brtnode_leaf(BRTNODE node, unsigned int basementnodesize) ...@@ -574,9 +570,8 @@ rebalance_brtnode_leaf(BRTNODE node, unsigned int basementnodesize)
} }
// now the basement nodes // now the basement nodes
for (int i = 0; i < num_children; i++) { for (int i = 0; i < num_children; i++) {
// put back optimized_for_upgrade and seqinsert // put back seqinsert
BLB_SEQINSERT(node, i) = tmp_seqinsert; BLB_SEQINSERT(node, i) = tmp_seqinsert;
BLB_OPTIMIZEDFORUPGRADE(node, i) = tmp_optimized_for_upgrade;
// create start (inclusive) and end (exclusive) boundaries for data of basement node // create start (inclusive) and end (exclusive) boundaries for data of basement node
u_int32_t curr_start = (i==0) ? 0 : new_pivots[i-1]+1; u_int32_t curr_start = (i==0) ? 0 : new_pivots[i-1]+1;
...@@ -976,7 +971,6 @@ BASEMENTNODE toku_create_empty_bn_no_buffer(void) { ...@@ -976,7 +971,6 @@ BASEMENTNODE toku_create_empty_bn_no_buffer(void) {
bn->buffer = NULL; bn->buffer = NULL;
bn->n_bytes_in_buffer = 0; bn->n_bytes_in_buffer = 0;
bn->seqinsert = 0; bn->seqinsert = 0;
bn->optimized_for_upgrade = 0;
bn->stale_ancestor_messages_applied = false; bn->stale_ancestor_messages_applied = false;
return bn; return bn;
} }
...@@ -1244,7 +1238,6 @@ deserialize_brtnode_partition( ...@@ -1244,7 +1238,6 @@ deserialize_brtnode_partition(
else { else {
unsigned char ch = rbuf_char(&rb); unsigned char ch = rbuf_char(&rb);
assert(ch == BRTNODE_PARTITION_OMT_LEAVES); assert(ch == BRTNODE_PARTITION_OMT_LEAVES);
BLB_OPTIMIZEDFORUPGRADE(node, index) = rbuf_int(&rb);
BLB_SEQINSERT(node, index) = 0; BLB_SEQINSERT(node, index) = 0;
u_int32_t num_entries = rbuf_int(&rb); u_int32_t num_entries = rbuf_int(&rb);
OMTVALUE *XMALLOC_N(num_entries, array); OMTVALUE *XMALLOC_N(num_entries, array);
......
...@@ -205,7 +205,6 @@ dump_node (int f, BLOCKNUM blocknum, struct brt_header *h) { ...@@ -205,7 +205,6 @@ dump_node (int f, BLOCKNUM blocknum, struct brt_header *h) {
); );
} }
} else { } else {
printf(" bn %2d: optimized_for_upgrade=%u", i, BLB_OPTIMIZEDFORUPGRADE(n, i));
printf(" n_bytes_in_buffer=%u", BLB_NBYTESINBUF(n, i)); printf(" n_bytes_in_buffer=%u", BLB_NBYTESINBUF(n, i));
printf(" items_in_buffer=%u\n", toku_omt_size(BLB_BUFFER(n, i))); printf(" items_in_buffer=%u\n", toku_omt_size(BLB_BUFFER(n, i)));
if (dump_data) toku_omt_iterate(BLB_BUFFER(n, i), print_le, 0); if (dump_data) toku_omt_iterate(BLB_BUFFER(n, i), print_le, 0);
......
...@@ -67,6 +67,7 @@ test_serialize_leaf(int valsize, int nelts, double entropy) { ...@@ -67,6 +67,7 @@ test_serialize_leaf(int valsize, int nelts, double entropy) {
sn.layout_version = BRT_LAYOUT_VERSION; sn.layout_version = BRT_LAYOUT_VERSION;
sn.layout_version_original = BRT_LAYOUT_VERSION; sn.layout_version_original = BRT_LAYOUT_VERSION;
sn.height = 0; sn.height = 0;
sn.optimized_for_upgrade = 1234;
sn.n_children = 8; sn.n_children = 8;
sn.dirty = 1; sn.dirty = 1;
MALLOC_N(sn.n_children, sn.bp); MALLOC_N(sn.n_children, sn.bp);
...@@ -79,7 +80,6 @@ test_serialize_leaf(int valsize, int nelts, double entropy) { ...@@ -79,7 +80,6 @@ test_serialize_leaf(int valsize, int nelts, double entropy) {
BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0); BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0);
BP_STATE(&sn,i) = PT_AVAIL; BP_STATE(&sn,i) = PT_AVAIL;
set_BLB(&sn, i, toku_create_empty_bn()); set_BLB(&sn, i, toku_create_empty_bn());
BLB_OPTIMIZEDFORUPGRADE(&sn, 0) = BRT_LAYOUT_VERSION;
} }
int nperbn = nelts / sn.n_children; int nperbn = nelts / sn.n_children;
LEAFENTRY les[nelts]; LEAFENTRY les[nelts];
...@@ -188,6 +188,7 @@ test_serialize_nonleaf(int valsize, int nelts, double entropy) { ...@@ -188,6 +188,7 @@ test_serialize_nonleaf(int valsize, int nelts, double entropy) {
sn.layout_version = BRT_LAYOUT_VERSION; sn.layout_version = BRT_LAYOUT_VERSION;
sn.layout_version_original = BRT_LAYOUT_VERSION; sn.layout_version_original = BRT_LAYOUT_VERSION;
sn.height = 1; sn.height = 1;
sn.optimized_for_upgrade = 1234;
sn.n_children = 8; sn.n_children = 8;
sn.dirty = 1; sn.dirty = 1;
MALLOC_N(sn.n_children, sn.bp); MALLOC_N(sn.n_children, sn.bp);
......
...@@ -220,9 +220,6 @@ test_serialize_leaf_check_msn(enum brtnode_verify_type bft) { ...@@ -220,9 +220,6 @@ test_serialize_leaf_check_msn(enum brtnode_verify_type bft) {
BLB_NBYTESINBUF(&sn, 1) = 1*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(&sn, 1)); BLB_NBYTESINBUF(&sn, 1) = 1*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(&sn, 1));
BLB_MAX_MSN_APPLIED(&sn, 0) = ((MSN) { MIN_MSN.msn + 73 }); BLB_MAX_MSN_APPLIED(&sn, 0) = ((MSN) { MIN_MSN.msn + 73 });
BLB_MAX_MSN_APPLIED(&sn, 1) = POSTSERIALIZE_MSN_ON_DISK; BLB_MAX_MSN_APPLIED(&sn, 1) = POSTSERIALIZE_MSN_ON_DISK;
for (int i = 0; i < 2; ++i) {
BLB_OPTIMIZEDFORUPGRADE(&sn, i) = BRT_LAYOUT_VERSION;
}
struct brt *XMALLOC(brt); struct brt *XMALLOC(brt);
struct brt_header *XCALLOC(brt_h); struct brt_header *XCALLOC(brt_h);
...@@ -290,7 +287,6 @@ test_serialize_leaf_check_msn(enum brtnode_verify_type bft) { ...@@ -290,7 +287,6 @@ test_serialize_leaf_check_msn(enum brtnode_verify_type bft) {
if (i < npartitions-1) { if (i < npartitions-1) {
assert(strcmp(kv_pair_key(dn->childkeys[i]), le_key_and_len(elts[extra.i-1], &keylen))==0); assert(strcmp(kv_pair_key(dn->childkeys[i]), le_key_and_len(elts[extra.i-1], &keylen))==0);
} }
assert(BLB_OPTIMIZEDFORUPGRADE(dn, i) == BRT_LAYOUT_VERSION);
// don't check soft_copy_is_up_to_date or seqinsert // don't check soft_copy_is_up_to_date or seqinsert
assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(dn, i))); assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(dn, i)));
last_i = extra.i; last_i = extra.i;
...@@ -358,7 +354,6 @@ test_serialize_leaf_with_large_pivots(enum brtnode_verify_type bft) { ...@@ -358,7 +354,6 @@ test_serialize_leaf_with_large_pivots(enum brtnode_verify_type bft) {
BP_SUBTREE_EST(&sn,i).dsize = random() + (((long long) random())<<32); BP_SUBTREE_EST(&sn,i).dsize = random() + (((long long) random())<<32);
BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0); BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0);
set_BLB(&sn, i, toku_create_empty_bn()); set_BLB(&sn, i, toku_create_empty_bn());
BLB_OPTIMIZEDFORUPGRADE(&sn, i) = BRT_LAYOUT_VERSION;
} }
for (int i = 0; i < nrows; ++i) { for (int i = 0; i < nrows; ++i) {
r = toku_omt_insert(BLB_BUFFER(&sn, i), les[i], omt_cmp, les[i], NULL); assert(r==0); r = toku_omt_insert(BLB_BUFFER(&sn, i), les[i], omt_cmp, les[i], NULL); assert(r==0);
...@@ -417,7 +412,6 @@ test_serialize_leaf_with_large_pivots(enum brtnode_verify_type bft) { ...@@ -417,7 +412,6 @@ test_serialize_leaf_with_large_pivots(enum brtnode_verify_type bft) {
} }
assert(toku_omt_size(BLB_BUFFER(dn, i)) > 0); assert(toku_omt_size(BLB_BUFFER(dn, i)) > 0);
toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra); toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra);
assert(BLB_OPTIMIZEDFORUPGRADE(dn, i) == BRT_LAYOUT_VERSION);
// don't check soft_copy_is_up_to_date or seqinsert // don't check soft_copy_is_up_to_date or seqinsert
assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+keylens+vallens) + toku_omt_size(BLB_BUFFER(dn, i))); assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+keylens+vallens) + toku_omt_size(BLB_BUFFER(dn, i)));
last_i = extra.i; last_i = extra.i;
...@@ -482,7 +476,6 @@ test_serialize_leaf_with_many_rows(enum brtnode_verify_type bft) { ...@@ -482,7 +476,6 @@ test_serialize_leaf_with_many_rows(enum brtnode_verify_type bft) {
BP_SUBTREE_EST(&sn,i).dsize = random() + (((long long) random())<<32); BP_SUBTREE_EST(&sn,i).dsize = random() + (((long long) random())<<32);
BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0); BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0);
set_BLB(&sn, i, toku_create_empty_bn()); set_BLB(&sn, i, toku_create_empty_bn());
BLB_OPTIMIZEDFORUPGRADE(&sn, i) = BRT_LAYOUT_VERSION;
} }
BLB_NBYTESINBUF(&sn, 0) = 0; BLB_NBYTESINBUF(&sn, 0) = 0;
for (int i = 0; i < nrows; ++i) { for (int i = 0; i < nrows; ++i) {
...@@ -537,7 +530,6 @@ test_serialize_leaf_with_many_rows(enum brtnode_verify_type bft) { ...@@ -537,7 +530,6 @@ test_serialize_leaf_with_many_rows(enum brtnode_verify_type bft) {
} }
assert(toku_omt_size(BLB_BUFFER(dn, i)) > 0); assert(toku_omt_size(BLB_BUFFER(dn, i)) > 0);
toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra); toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra);
assert(BLB_OPTIMIZEDFORUPGRADE(dn, i) == BRT_LAYOUT_VERSION);
// don't check soft_copy_is_up_to_date or seqinsert // don't check soft_copy_is_up_to_date or seqinsert
assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+keylens+vallens) + toku_omt_size(BLB_BUFFER(dn, i))); assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+keylens+vallens) + toku_omt_size(BLB_BUFFER(dn, i)));
assert(BLB_NBYTESINBUF(dn, i) < 128*1024); // BN_MAX_SIZE, apt to change assert(BLB_NBYTESINBUF(dn, i) < 128*1024); // BN_MAX_SIZE, apt to change
...@@ -608,7 +600,6 @@ test_serialize_leaf_with_large_rows(enum brtnode_verify_type bft) { ...@@ -608,7 +600,6 @@ test_serialize_leaf_with_large_rows(enum brtnode_verify_type bft) {
BP_SUBTREE_EST(&sn,i).dsize = random() + (((long long) random())<<32); BP_SUBTREE_EST(&sn,i).dsize = random() + (((long long) random())<<32);
BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0); BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0);
set_BLB(&sn, i, toku_create_empty_bn()); set_BLB(&sn, i, toku_create_empty_bn());
BLB_OPTIMIZEDFORUPGRADE(&sn, i) = BRT_LAYOUT_VERSION;
} }
BLB_NBYTESINBUF(&sn, 0) = 0; BLB_NBYTESINBUF(&sn, 0) = 0;
for (int i = 0; i < 7; ++i) { for (int i = 0; i < 7; ++i) {
...@@ -664,7 +655,6 @@ test_serialize_leaf_with_large_rows(enum brtnode_verify_type bft) { ...@@ -664,7 +655,6 @@ test_serialize_leaf_with_large_rows(enum brtnode_verify_type bft) {
} }
assert(toku_omt_size(BLB_BUFFER(dn, i)) > 0); assert(toku_omt_size(BLB_BUFFER(dn, i)) > 0);
toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra); toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra);
assert(BLB_OPTIMIZEDFORUPGRADE(dn, i) == BRT_LAYOUT_VERSION);
// don't check soft_copy_is_up_to_date or seqinsert // don't check soft_copy_is_up_to_date or seqinsert
assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+8+val_size) + toku_omt_size(BLB_BUFFER(dn, i))); assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+8+val_size) + toku_omt_size(BLB_BUFFER(dn, i)));
last_i = extra.i; last_i = extra.i;
...@@ -732,7 +722,6 @@ test_serialize_leaf_with_empty_basement_nodes(enum brtnode_verify_type bft) { ...@@ -732,7 +722,6 @@ test_serialize_leaf_with_empty_basement_nodes(enum brtnode_verify_type bft) {
BP_SUBTREE_EST(&sn,i).dsize = random() + (((long long)random())<<32); BP_SUBTREE_EST(&sn,i).dsize = random() + (((long long)random())<<32);
BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0); BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0);
set_BLB(&sn, i, toku_create_empty_bn()); set_BLB(&sn, i, toku_create_empty_bn());
BLB_OPTIMIZEDFORUPGRADE(&sn, i) = BRT_LAYOUT_VERSION;
BLB_SEQINSERT(&sn, i) = 0; BLB_SEQINSERT(&sn, i) = 0;
} }
r = toku_omt_insert(BLB_BUFFER(&sn, 1), elts[0], omt_cmp, elts[0], NULL); assert(r==0); r = toku_omt_insert(BLB_BUFFER(&sn, 1), elts[0], omt_cmp, elts[0], NULL); assert(r==0);
...@@ -797,7 +786,6 @@ test_serialize_leaf_with_empty_basement_nodes(enum brtnode_verify_type bft) { ...@@ -797,7 +786,6 @@ test_serialize_leaf_with_empty_basement_nodes(enum brtnode_verify_type bft) {
} }
assert(toku_omt_size(BLB_BUFFER(dn, i)) > 0); assert(toku_omt_size(BLB_BUFFER(dn, i)) > 0);
toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra); toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra);
assert(BLB_OPTIMIZEDFORUPGRADE(dn, i) == BRT_LAYOUT_VERSION);
// don't check soft_copy_is_up_to_date or seqinsert // don't check soft_copy_is_up_to_date or seqinsert
assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(dn, i))); assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(dn, i)));
last_i = extra.i; last_i = extra.i;
...@@ -858,7 +846,6 @@ test_serialize_leaf_with_multiple_empty_basement_nodes(enum brtnode_verify_type ...@@ -858,7 +846,6 @@ test_serialize_leaf_with_multiple_empty_basement_nodes(enum brtnode_verify_type
BP_SUBTREE_EST(&sn,i).dsize = random() + (((long long)random())<<32); BP_SUBTREE_EST(&sn,i).dsize = random() + (((long long)random())<<32);
BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0); BP_SUBTREE_EST(&sn,i).exact = (BOOL)(random()%2 != 0);
set_BLB(&sn, i, toku_create_empty_bn()); set_BLB(&sn, i, toku_create_empty_bn());
BLB_OPTIMIZEDFORUPGRADE(&sn, i) = BRT_LAYOUT_VERSION;
} }
BLB_NBYTESINBUF(&sn, 0) = 0*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(&sn, 0)); BLB_NBYTESINBUF(&sn, 0) = 0*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(&sn, 0));
BLB_NBYTESINBUF(&sn, 1) = 0*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(&sn, 1)); BLB_NBYTESINBUF(&sn, 1) = 0*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(&sn, 1));
...@@ -916,7 +903,6 @@ test_serialize_leaf_with_multiple_empty_basement_nodes(enum brtnode_verify_type ...@@ -916,7 +903,6 @@ test_serialize_leaf_with_multiple_empty_basement_nodes(enum brtnode_verify_type
} }
assert(toku_omt_size(BLB_BUFFER(dn, i)) == 0); assert(toku_omt_size(BLB_BUFFER(dn, i)) == 0);
toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra); toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra);
assert(BLB_OPTIMIZEDFORUPGRADE(dn, i) == BRT_LAYOUT_VERSION);
// don't check soft_copy_is_up_to_date or seqinsert // don't check soft_copy_is_up_to_date or seqinsert
assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(dn, i))); assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(dn, i)));
last_i = extra.i; last_i = extra.i;
...@@ -987,9 +973,6 @@ test_serialize_leaf(enum brtnode_verify_type bft) { ...@@ -987,9 +973,6 @@ test_serialize_leaf(enum brtnode_verify_type bft) {
r = toku_omt_insert(BLB_BUFFER(&sn, 1), elts[2], omt_cmp, elts[2], NULL); assert(r==0); r = toku_omt_insert(BLB_BUFFER(&sn, 1), elts[2], omt_cmp, elts[2], NULL); assert(r==0);
BLB_NBYTESINBUF(&sn, 0) = 2*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(&sn, 0)); BLB_NBYTESINBUF(&sn, 0) = 2*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(&sn, 0));
BLB_NBYTESINBUF(&sn, 1) = 1*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(&sn, 1)); BLB_NBYTESINBUF(&sn, 1) = 1*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(&sn, 1));
for (int i = 0; i < 2; ++i) {
BLB_OPTIMIZEDFORUPGRADE(&sn, i) = BRT_LAYOUT_VERSION;
}
struct brt *XMALLOC(brt); struct brt *XMALLOC(brt);
struct brt_header *XCALLOC(brt_h); struct brt_header *XCALLOC(brt_h);
...@@ -1045,7 +1028,6 @@ test_serialize_leaf(enum brtnode_verify_type bft) { ...@@ -1045,7 +1028,6 @@ test_serialize_leaf(enum brtnode_verify_type bft) {
if (i < npartitions-1) { if (i < npartitions-1) {
assert(strcmp(kv_pair_key(dn->childkeys[i]), le_key_and_len(elts[extra.i-1], &keylen))==0); assert(strcmp(kv_pair_key(dn->childkeys[i]), le_key_and_len(elts[extra.i-1], &keylen))==0);
} }
assert(BLB_OPTIMIZEDFORUPGRADE(dn, i) == BRT_LAYOUT_VERSION);
// don't check soft_copy_is_up_to_date or seqinsert // don't check soft_copy_is_up_to_date or seqinsert
assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(dn, i))); assert(BLB_NBYTESINBUF(dn, i) == (extra.i-last_i)*(KEY_VALUE_OVERHEAD+2+5) + toku_omt_size(BLB_BUFFER(dn, i)));
last_i = extra.i; last_i = extra.i;
......
...@@ -62,6 +62,7 @@ test_split_on_boundary(void) ...@@ -62,6 +62,7 @@ test_split_on_boundary(void)
sn.layout_version = BRT_LAYOUT_VERSION; sn.layout_version = BRT_LAYOUT_VERSION;
sn.layout_version_original = BRT_LAYOUT_VERSION; sn.layout_version_original = BRT_LAYOUT_VERSION;
sn.height = 0; sn.height = 0;
sn.optimized_for_upgrade = 1324;
const int nelts = 2 * nodesize / eltsize; const int nelts = 2 * nodesize / eltsize;
sn.n_children = nelts * eltsize / bnsize; sn.n_children = nelts * eltsize / bnsize;
sn.dirty = 1; sn.dirty = 1;
...@@ -77,7 +78,6 @@ test_split_on_boundary(void) ...@@ -77,7 +78,6 @@ test_split_on_boundary(void)
BP_STATE(&sn,bn) = PT_AVAIL; BP_STATE(&sn,bn) = PT_AVAIL;
set_BLB(&sn, bn, toku_create_empty_bn()); set_BLB(&sn, bn, toku_create_empty_bn());
BLB_NBYTESINBUF(&sn,bn) = 0; BLB_NBYTESINBUF(&sn,bn) = 0;
BLB_OPTIMIZEDFORUPGRADE(&sn, bn) = BRT_LAYOUT_VERSION;
long k; long k;
for (int i = 0; i < eltsperbn; ++i) { for (int i = 0; i < eltsperbn; ++i) {
k = bn * eltsperbn + i; k = bn * eltsperbn + i;
...@@ -144,6 +144,7 @@ test_split_with_everything_on_the_left(void) ...@@ -144,6 +144,7 @@ test_split_with_everything_on_the_left(void)
sn.layout_version = BRT_LAYOUT_VERSION; sn.layout_version = BRT_LAYOUT_VERSION;
sn.layout_version_original = BRT_LAYOUT_VERSION; sn.layout_version_original = BRT_LAYOUT_VERSION;
sn.height = 0; sn.height = 0;
sn.optimized_for_upgrade = 1324;
const int nelts = 2 * nodesize / eltsize; const int nelts = 2 * nodesize / eltsize;
sn.n_children = nelts * eltsize / bnsize + 1; sn.n_children = nelts * eltsize / bnsize + 1;
sn.dirty = 1; sn.dirty = 1;
...@@ -161,7 +162,6 @@ test_split_with_everything_on_the_left(void) ...@@ -161,7 +162,6 @@ test_split_with_everything_on_the_left(void)
BP_STATE(&sn,bn) = PT_AVAIL; BP_STATE(&sn,bn) = PT_AVAIL;
set_BLB(&sn, bn, toku_create_empty_bn()); set_BLB(&sn, bn, toku_create_empty_bn());
BLB_NBYTESINBUF(&sn,bn) = 0; BLB_NBYTESINBUF(&sn,bn) = 0;
BLB_OPTIMIZEDFORUPGRADE(&sn, bn) = BRT_LAYOUT_VERSION;
long k; long k;
if (bn < sn.n_children - 1) { if (bn < sn.n_children - 1) {
for (int i = 0; i < eltsperbn; ++i) { for (int i = 0; i < eltsperbn; ++i) {
...@@ -238,6 +238,7 @@ test_split_on_boundary_of_last_node(void) ...@@ -238,6 +238,7 @@ test_split_on_boundary_of_last_node(void)
sn.layout_version = BRT_LAYOUT_VERSION; sn.layout_version = BRT_LAYOUT_VERSION;
sn.layout_version_original = BRT_LAYOUT_VERSION; sn.layout_version_original = BRT_LAYOUT_VERSION;
sn.height = 0; sn.height = 0;
sn.optimized_for_upgrade = 1324;
const int nelts = 2 * nodesize / eltsize; const int nelts = 2 * nodesize / eltsize;
sn.n_children = nelts * eltsize / bnsize + 1; sn.n_children = nelts * eltsize / bnsize + 1;
sn.dirty = 1; sn.dirty = 1;
...@@ -255,7 +256,6 @@ test_split_on_boundary_of_last_node(void) ...@@ -255,7 +256,6 @@ test_split_on_boundary_of_last_node(void)
BP_STATE(&sn,bn) = PT_AVAIL; BP_STATE(&sn,bn) = PT_AVAIL;
set_BLB(&sn, bn, toku_create_empty_bn()); set_BLB(&sn, bn, toku_create_empty_bn());
BLB_NBYTESINBUF(&sn,bn) = 0; BLB_NBYTESINBUF(&sn,bn) = 0;
BLB_OPTIMIZEDFORUPGRADE(&sn, bn) = BRT_LAYOUT_VERSION;
long k; long k;
if (bn < sn.n_children - 1) { if (bn < sn.n_children - 1) {
for (int i = 0; i < eltsperbn; ++i) { for (int i = 0; i < eltsperbn; ++i) {
...@@ -332,6 +332,7 @@ test_split_at_begin(void) ...@@ -332,6 +332,7 @@ test_split_at_begin(void)
sn.layout_version = BRT_LAYOUT_VERSION; sn.layout_version = BRT_LAYOUT_VERSION;
sn.layout_version_original = BRT_LAYOUT_VERSION; sn.layout_version_original = BRT_LAYOUT_VERSION;
sn.height = 0; sn.height = 0;
sn.optimized_for_upgrade = 1324;
const int nelts = 2 * nodesize / eltsize; const int nelts = 2 * nodesize / eltsize;
sn.n_children = nelts * eltsize / bnsize; sn.n_children = nelts * eltsize / bnsize;
sn.dirty = 1; sn.dirty = 1;
...@@ -348,7 +349,6 @@ test_split_at_begin(void) ...@@ -348,7 +349,6 @@ test_split_at_begin(void)
BP_STATE(&sn,bn) = PT_AVAIL; BP_STATE(&sn,bn) = PT_AVAIL;
set_BLB(&sn, bn, toku_create_empty_bn()); set_BLB(&sn, bn, toku_create_empty_bn());
BLB_NBYTESINBUF(&sn,bn) = 0; BLB_NBYTESINBUF(&sn,bn) = 0;
BLB_OPTIMIZEDFORUPGRADE(&sn, bn) = BRT_LAYOUT_VERSION;
long k; long k;
for (int i = 0; i < eltsperbn; ++i) { for (int i = 0; i < eltsperbn; ++i) {
k = bn * eltsperbn + i; k = bn * eltsperbn + i;
...@@ -430,6 +430,7 @@ test_split_at_end(void) ...@@ -430,6 +430,7 @@ test_split_at_end(void)
sn.layout_version = BRT_LAYOUT_VERSION; sn.layout_version = BRT_LAYOUT_VERSION;
sn.layout_version_original = BRT_LAYOUT_VERSION; sn.layout_version_original = BRT_LAYOUT_VERSION;
sn.height = 0; sn.height = 0;
sn.optimized_for_upgrade = 1324;
const int nelts = 2 * nodesize / eltsize; const int nelts = 2 * nodesize / eltsize;
sn.n_children = nelts * eltsize / bnsize; sn.n_children = nelts * eltsize / bnsize;
sn.dirty = 1; sn.dirty = 1;
...@@ -446,7 +447,6 @@ test_split_at_end(void) ...@@ -446,7 +447,6 @@ test_split_at_end(void)
BP_STATE(&sn,bn) = PT_AVAIL; BP_STATE(&sn,bn) = PT_AVAIL;
set_BLB(&sn, bn, toku_create_empty_bn()); set_BLB(&sn, bn, toku_create_empty_bn());
BLB_NBYTESINBUF(&sn,bn) = 0; BLB_NBYTESINBUF(&sn,bn) = 0;
BLB_OPTIMIZEDFORUPGRADE(&sn, bn) = BRT_LAYOUT_VERSION;
long k; long k;
for (int i = 0; i < eltsperbn; ++i) { for (int i = 0; i < eltsperbn; ++i) {
k = bn * eltsperbn + i; k = bn * eltsperbn + 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