diff --git a/newbrt/brt.c b/newbrt/brt.c index 91fee064ce7..65e539b18db 100644 --- a/newbrt/brt.c +++ b/newbrt/brt.c @@ -727,8 +727,6 @@ brtleaf_split (TOKULOGGER logger, FILENUM filenum, BRT t, BRTNODE node, BRTNODE u_int32_t n_leafentries = toku_omt_size(node->u.l.buffer); u_int32_t break_at = 0; - node->u.l.seqinsert = 0; - // Don't mess around with splitting specially for sequential insertions any more. { OMTVALUE *MALLOC_N(n_leafentries, leafentries); assert(leafentries); @@ -739,10 +737,15 @@ brtleaf_split (TOKULOGGER logger, FILENUM filenum, BRT t, BRTNODE node, BRTNODE u_int32_t sumlesizes=0; for (i=0; iu.l.seqinsert*2 >= n_leafentries) f = 4; // 1/4 + node->u.l.seqinsert = 0; + for (i=n_leafentries-1; i>0; i--) { assert(toku_mempool_inrange(&node->u.l.buffer_mempool, leafentries[i], leafentry_memsize(leafentries[i]))); sumsofar += leafentry_disksize(leafentries[i]); - if (sumsofar*2 >= sumlesizes) { + if (sumsofar*f >= sumlesizes) { break_at = i; break; }