Commit c61cedcc 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 f3c2d203
...@@ -1072,7 +1072,7 @@ flush_this_child( ...@@ -1072,7 +1072,7 @@ flush_this_child(
set_BNC(node, childnum, toku_create_empty_nl()); set_BNC(node, childnum, toku_create_empty_nl());
// now we have a bnc to flush to the child // 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); destroy_nonleaf_childinfo(bnc);
} }
...@@ -1571,10 +1571,7 @@ flush_some_child( ...@@ -1571,10 +1571,7 @@ flush_some_child(
} }
// do the actual flush // do the actual flush
r = toku_bnc_flush_to_child( r = toku_bnc_flush_to_child(
h->compare_fun, h,
h->update_fun,
&h->cmp_descriptor,
h->cf,
bnc, bnc,
child child
); );
...@@ -1733,10 +1730,7 @@ static void flush_node_fun(void *fe_v) ...@@ -1733,10 +1730,7 @@ static void flush_node_fun(void *fe_v)
call_flusher_thread_callback(ft_flush_before_applying_inbox); call_flusher_thread_callback(ft_flush_before_applying_inbox);
r = toku_bnc_flush_to_child( r = toku_bnc_flush_to_child(
fe->h->compare_fun, fe->h,
fe->h->update_fun,
&fe->h->cmp_descriptor,
fe->h->cf,
fe->bnc, fe->bnc,
fe->node fe->node
); );
......
...@@ -136,10 +136,7 @@ long toku_bnc_memory_used(NONLEAF_CHILDINFO bnc); ...@@ -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); 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); void toku_bnc_empty(NONLEAF_CHILDINFO bnc);
int toku_bnc_flush_to_child( int toku_bnc_flush_to_child(
brt_compare_func compare_fun, struct brt_header* h,
brt_update_func update_fun,
DESCRIPTOR desc,
CACHEFILE cf,
NONLEAF_CHILDINFO bnc, NONLEAF_CHILDINFO bnc,
BRTNODE child BRTNODE child
); );
......
...@@ -2230,10 +2230,7 @@ brt_leaf_gc_all_les(BRTNODE node, ...@@ -2230,10 +2230,7 @@ brt_leaf_gc_all_les(BRTNODE node,
int int
toku_bnc_flush_to_child( toku_bnc_flush_to_child(
brt_compare_func compare_fun, struct brt_header* h,
brt_update_func update_fun,
DESCRIPTOR desc,
CACHEFILE cf,
NONLEAF_CHILDINFO bnc, NONLEAF_CHILDINFO bnc,
BRTNODE child BRTNODE child
) )
...@@ -2247,9 +2244,9 @@ toku_bnc_flush_to_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), BRT_MSG_S brtcmd = { type, msn, xids, .u.id= {toku_fill_dbt(&hk, key, keylen),
toku_fill_dbt(&hv, val, vallen)} }; toku_fill_dbt(&hv, val, vallen)} };
brtnode_put_cmd( brtnode_put_cmd(
compare_fun, h->compare_fun,
update_fun, h->update_fun,
desc, &h->cmp_descriptor,
child, child,
&brtcmd, &brtcmd,
is_fresh is_fresh
...@@ -2257,7 +2254,7 @@ toku_bnc_flush_to_child( ...@@ -2257,7 +2254,7 @@ toku_bnc_flush_to_child(
})); }));
// Run garbage collection, if we are a leaf entry. // 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) { if (child->height == 0 && logger) {
int r; int r;
OMT snapshot_txnids = NULL; OMT snapshot_txnids = NULL;
......
...@@ -278,7 +278,7 @@ flush_to_internal(BRT t) { ...@@ -278,7 +278,7 @@ flush_to_internal(BRT t) {
set_BNC(child, 0, child_bnc); set_BNC(child, 0, child_bnc);
BP_STATE(child, 0) = PT_AVAIL; 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 parent_messages_present[num_parent_messages];
int child_messages_present[num_child_messages]; int child_messages_present[num_child_messages];
...@@ -413,7 +413,7 @@ flush_to_internal_multiple(BRT t) { ...@@ -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; int total_messages = 0;
for (i = 0; i < 8; ++i) { for (i = 0; i < 8; ++i) {
...@@ -605,7 +605,7 @@ flush_to_leaf(BRT t, bool make_leaf_up_to_date, bool use_flush) { ...@@ -605,7 +605,7 @@ flush_to_leaf(BRT t, bool make_leaf_up_to_date, bool use_flush) {
} }
if (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); destroy_nonleaf_childinfo(parent_bnc);
} else { } else {
BRTNODE XMALLOC(parentnode); BRTNODE XMALLOC(parentnode);
...@@ -1016,7 +1016,7 @@ compare_apply_and_flush(BRT t, bool make_leaf_up_to_date) { ...@@ -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); BRTNODE XMALLOC(parentnode);
BLOCKNUM parentblocknum = { 17 }; BLOCKNUM parentblocknum = { 17 };
...@@ -1130,6 +1130,8 @@ test_main (int argc, const char *argv[]) { ...@@ -1130,6 +1130,8 @@ test_main (int argc, const char *argv[]) {
BRT t; 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_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); 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) { for (int i = 0; i < 10; ++i) {
flush_to_internal(t); 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