Commit 0f8d429f authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4741], fix toku_bnc_flush_to_child

git-svn-id: file:///svn/toku/tokudb@43532 c7de825b-a66e-492c-adef-691d508d4ae1
parent df965c91
......@@ -1072,7 +1072,7 @@ flush_this_child(
set_BNC(node, childnum, toku_create_empty_nl());
// now we have a bnc to flush to the child
r = toku_bnc_flush_to_child(h->compare_fun, h->update_fun, &h->cmp_descriptor, h->cf, bnc, child); assert_zero(r);
r = toku_bnc_flush_to_child(h, bnc, child); assert_zero(r);
destroy_nonleaf_childinfo(bnc);
}
......@@ -1571,10 +1571,7 @@ flush_some_child(
}
// do the actual flush
r = toku_bnc_flush_to_child(
h->compare_fun,
h->update_fun,
&h->cmp_descriptor,
h->cf,
h,
bnc,
child
);
......@@ -1733,10 +1730,7 @@ static void flush_node_fun(void *fe_v)
call_flusher_thread_callback(ft_flush_before_applying_inbox);
r = toku_bnc_flush_to_child(
fe->h->compare_fun,
fe->h->update_fun,
&fe->h->cmp_descriptor,
fe->h->cf,
fe->h,
fe->bnc,
fe->node
);
......
......@@ -136,10 +136,7 @@ long toku_bnc_memory_used(NONLEAF_CHILDINFO bnc);
int toku_bnc_insert_msg(NONLEAF_CHILDINFO bnc, const void *key, ITEMLEN keylen, const void *data, ITEMLEN datalen, enum brt_msg_type type, MSN msn, XIDS xids, bool is_fresh, DESCRIPTOR desc, brt_compare_func cmp);
void toku_bnc_empty(NONLEAF_CHILDINFO bnc);
int toku_bnc_flush_to_child(
brt_compare_func compare_fun,
brt_update_func update_fun,
DESCRIPTOR desc,
CACHEFILE cf,
struct brt_header* h,
NONLEAF_CHILDINFO bnc,
BRTNODE child
);
......
......@@ -2230,10 +2230,7 @@ brt_leaf_gc_all_les(BRTNODE node,
int
toku_bnc_flush_to_child(
brt_compare_func compare_fun,
brt_update_func update_fun,
DESCRIPTOR desc,
CACHEFILE cf,
struct brt_header* h,
NONLEAF_CHILDINFO bnc,
BRTNODE child
)
......@@ -2247,9 +2244,9 @@ toku_bnc_flush_to_child(
BRT_MSG_S brtcmd = { type, msn, xids, .u.id= {toku_fill_dbt(&hk, key, keylen),
toku_fill_dbt(&hv, val, vallen)} };
brtnode_put_cmd(
compare_fun,
update_fun,
desc,
h->compare_fun,
h->update_fun,
&h->cmp_descriptor,
child,
&brtcmd,
is_fresh
......@@ -2257,7 +2254,7 @@ toku_bnc_flush_to_child(
}));
// Run garbage collection, if we are a leaf entry.
TOKULOGGER logger = toku_cachefile_logger(cf);
TOKULOGGER logger = toku_cachefile_logger(h->cf);
if (child->height == 0 && logger) {
int r;
OMT snapshot_txnids = NULL;
......
......@@ -278,7 +278,7 @@ flush_to_internal(BRT t) {
set_BNC(child, 0, child_bnc);
BP_STATE(child, 0) = PT_AVAIL;
toku_bnc_flush_to_child(t->compare_fun, t->update_fun, &t->h->descriptor, t->h->cf, parent_bnc, child);
toku_bnc_flush_to_child(t->h, parent_bnc, child);
int parent_messages_present[num_parent_messages];
int child_messages_present[num_child_messages];
......@@ -413,7 +413,7 @@ flush_to_internal_multiple(BRT t) {
}
}
toku_bnc_flush_to_child(t->compare_fun, t->update_fun, &t->h->descriptor, t->h->cf, parent_bnc, child);
toku_bnc_flush_to_child(t->h, parent_bnc, child);
int total_messages = 0;
for (i = 0; i < 8; ++i) {
......@@ -605,7 +605,7 @@ flush_to_leaf(BRT t, bool make_leaf_up_to_date, bool use_flush) {
}
if (use_flush) {
toku_bnc_flush_to_child(t->compare_fun, t->update_fun, &t->h->descriptor, t->h->cf, parent_bnc, child);
toku_bnc_flush_to_child(t->h, parent_bnc, child);
destroy_nonleaf_childinfo(parent_bnc);
} else {
BRTNODE XMALLOC(parentnode);
......@@ -1016,7 +1016,7 @@ compare_apply_and_flush(BRT t, bool make_leaf_up_to_date) {
}
}
toku_bnc_flush_to_child(t->compare_fun, t->update_fun, &t->h->descriptor, t->h->cf, parent_bnc, child1);
toku_bnc_flush_to_child(t->h, parent_bnc, child1);
BRTNODE XMALLOC(parentnode);
BLOCKNUM parentblocknum = { 17 };
......@@ -1130,6 +1130,8 @@ test_main (int argc, const char *argv[]) {
BRT t;
r = toku_open_brt(fname, 1, &t, 128*1024, 4096, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
r = toku_brt_set_update(t, orthopush_flush_update_fun); assert(r==0);
// HACK
t->h->update_fun = orthopush_flush_update_fun;
for (int i = 0; i < 10; ++i) {
flush_to_internal(t);
......
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