Commit af27d521 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#3461 fix the leaf splitter WRT large rows closes[t:3461]

git-svn-id: file:///svn/toku/tokudb@30311 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1c5f21a5
......@@ -801,7 +801,6 @@ brtleaf_split (BRT t, BRTNODE node, BRTNODE *nodea, BRTNODE *nodeb, DBT *splitk)
OMTVALUE *MALLOC_N(n_leafentries, leafentries);
lazy_assert(leafentries);
toku_omt_iterate(node->u.l.buffer, fill_buf, leafentries);
split_at = 0;
{
u_int32_t i;
u_int64_t sumlesizes=0, sumsofar;
......@@ -837,10 +836,15 @@ brtleaf_split (BRT t, BRTNODE node, BRTNODE *nodea, BRTNODE *nodeb, DBT *splitk)
}
}
}
if (split_at == 0)
split_at = 1;
//TODO: #1125 REMOVE DEBUG
lazy_assert( sumsofar <= toku_mempool_get_size(&B ->u.l.buffer_mempool));
lazy_assert(sumlesizes - sumsofar <= toku_mempool_get_size(&node->u.l.buffer_mempool));
assert( sumsofar <= toku_mempool_get_size(&B ->u.l.buffer_mempool));
assert(sumlesizes - sumsofar <= toku_mempool_get_size(&node->u.l.buffer_mempool));
}
assert(0 < split_at && split_at < n_leafentries); // the split point must put rows on both the left and right sides!
// Now we know where we are going to break it
OMT old_omt = node->u.l.buffer;
toku_omt_destroy(&B->u.l.buffer); // Destroy B's empty OMT, so I can rebuild it from an array
......
......@@ -219,6 +219,7 @@ BDB_DONTRUN_TESTS = \
test_abort1 \
test_abort4 \
test_abort5 \
test_blobs_leaf_split \
test_cursor_delete_2119 \
test_db_descriptor \
test_db_descriptor_named_db \
......
......@@ -6,7 +6,8 @@ static void insert(DB *db, DB_TXN *txn, int k, int val_size) {
int r;
// generate the key
char key_buffer[8];
char key_buffer[8];
memset(key_buffer, 0, sizeof key_buffer);
int newa = htonl(k);
memcpy(key_buffer, &newa, sizeof newa);
......@@ -23,9 +24,9 @@ static void insert(DB *db, DB_TXN *txn, int k, int val_size) {
int test_main(int argc, char * const argv[]) {
#if defined(TOKUDB)
char *db_env_dir = "blobs.leafsplit.env.tdb";
char *db_env_dir = "dir.blobs.leafsplit.env.tdb";
#else
char *db_env_dir = "blobs.leafsplit.env.bdb";
char *db_env_dir = "dir.blobs.leafsplit.env.bdb";
#endif
int db_env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG;
char *db_filename = "blobs.db";
......
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