From 3266e6d20cae74dab54b56f8ded11f8a63e640ed Mon Sep 17 00:00:00 2001 From: "Bradley C. Kuszmaul" Date: Thu, 31 Jan 2008 14:52:52 +0000 Subject: [PATCH] db-benchmark-test now recovers OK. Addresses #27. git-svn-id: file:///svn/tokudb@1988 c7de825b-a66e-492c-adef-691d508d4ae1 --- newbrt/brt.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/newbrt/brt.c b/newbrt/brt.c index a5b0bd2ab8f..728afc5fc27 100644 --- a/newbrt/brt.c +++ b/newbrt/brt.c @@ -632,16 +632,20 @@ static int handle_split_of_child (BRT t, BRTNODE node, int childnum, // Slide the keys over { + struct kv_pair *pivot = childsplitk->data; BYTESTRING bs = { .len = childsplitk->size, - .data = childsplitk->data }; + .data = kv_pair_key(pivot) }; r = toku_log_setpivot(txn, toku_txn_get_txnid(txn), toku_cachefile_filenum(t->cf), node->thisnodename, childnum, bs); if (r!=0) return r; + + for (cnum=node->u.n.n_children-1; cnum>childnum; cnum--) { + node->u.n.childkeys[cnum] = node->u.n.childkeys[cnum-1]; + } + assert((t->flags&TOKU_DB_DUPSORT)==0); // none of this works for dupsort databases. The size is wrong. The setpivot is wrong. + node->u.n.childkeys[childnum]= pivot; + node->u.n.totalchildkeylens += childsplitk->size; } - for (cnum=node->u.n.n_children-1; cnum>childnum; cnum--) { - node->u.n.childkeys[cnum] = node->u.n.childkeys[cnum-1]; - } - node->u.n.childkeys[childnum]= (void*)childsplitk->data; - node->u.n.totalchildkeylens += childsplitk->size; + node->u.n.n_children++; if (toku_brt_debug_mode) {