Commit 433e2bab authored by John Esmet's avatar John Esmet

Tests compile now

parent f176288d
......@@ -360,6 +360,16 @@ toku_pin_ftnode_with_dep_nodes(
*node_p = node;
}
void toku_pin_ftnode(FT ft,
BLOCKNUM blocknum,
uint32_t fullhash,
FTNODE_FETCH_EXTRA bfe,
pair_lock_type lock_type,
FTNODE *node_p,
bool move_messages) {
toku_pin_ftnode_with_dep_nodes(ft, blocknum, fullhash, bfe, lock_type, 0, nullptr, node_p, move_messages);
}
int toku_maybe_pin_ftnode_clean(FT ft, BLOCKNUM blocknum, uint32_t fullhash, pair_lock_type lock_type, FTNODE *nodep) {
void *node_v;
int r = toku_cachetable_maybe_get_and_pin_clean(ft->cf, blocknum, fullhash, lock_type, &node_v);
......
......@@ -138,6 +138,7 @@ toku_create_new_ftnode (
int n_children
);
// This function returns a pinned ftnode to the caller.
int
toku_pin_ftnode_for_query(
FT_HANDLE brt,
......@@ -152,15 +153,20 @@ toku_pin_ftnode_for_query(
bool* msgs_applied
);
/**
* Unfortunately, this function is poorly named
* as over time, client threads have also started
* calling this function.
* This function returns a pinned ftnode to the caller.
* Unlike toku_pin_ftnode, this function blocks until the node is pinned.
*/
void
toku_pin_ftnode_with_dep_nodes(
// Pins an ftnode without dependent pairs
void toku_pin_ftnode(
FT h,
BLOCKNUM blocknum,
uint32_t fullhash,
FTNODE_FETCH_EXTRA bfe,
pair_lock_type lock_type,
FTNODE *node_p,
bool move_messages
);
// Pins an ftnode with dependent pairs
// Unlike toku_pin_ftnode_for_query, this function blocks until the node is pinned.
void toku_pin_ftnode_with_dep_nodes(
FT h,
BLOCKNUM blocknum,
uint32_t fullhash,
......
......@@ -496,7 +496,7 @@ ct_maybe_merge_child(struct flusher_advice *fa,
toku_calculate_root_offset_pointer(h, &root, &fullhash);
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, h);
toku_pin_ftnode_with_dep_nodes(h, root, fullhash, &bfe, PL_WRITE_EXPENSIVE, 0, NULL, &root_node, true);
toku_pin_ftnode(h, root, fullhash, &bfe, PL_WRITE_EXPENSIVE, &root_node, true);
toku_assert_entire_node_in_memory(root_node);
}
......
......@@ -332,15 +332,13 @@ toku_ft_hot_optimize(FT_HANDLE brt, DBT* left, DBT* right,
toku_calculate_root_offset_pointer(brt->ft, &root_key, &fullhash);
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_nodes(brt->ft,
(BLOCKNUM) root_key,
fullhash,
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&root,
true);
toku_pin_ftnode(brt->ft,
(BLOCKNUM) root_key,
fullhash,
&bfe,
PL_WRITE_EXPENSIVE,
&root,
true);
toku_assert_entire_node_in_memory(root);
}
......
......@@ -1674,14 +1674,12 @@ ft_init_new_root(FT ft, FTNODE oldroot, FTNODE *newrootp)
// return to caller
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, ft);
toku_pin_ftnode_with_dep_nodes(
toku_pin_ftnode(
ft,
old_blocknum,
old_fullhash,
&bfe,
PL_WRITE_EXPENSIVE, // may_modify_node
0,
NULL,
newrootp,
true
);
......@@ -2793,7 +2791,7 @@ static bool process_maybe_reactive_child(FT ft, FTNODE parent, FTNODE child, int
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, ft);
FTNODE newparent, newchild;
toku_pin_ftnode_with_dep_nodes(ft, parent_blocknum, parent_fullhash, &bfe, PL_WRITE_CHEAP, 0, nullptr, &newparent, true);
toku_pin_ftnode(ft, parent_blocknum, parent_fullhash, &bfe, PL_WRITE_CHEAP, &newparent, true);
if (newparent->height != parent_height || newparent->n_children != parent_n_children ||
childnum >= newparent->n_children || toku_bnc_n_entries(BNC(newparent, childnum))) {
// If the height changed or childnum is now off the end, something clearly got split or merged out from under us.
......@@ -2845,7 +2843,7 @@ static bool process_maybe_reactive_child(FT ft, FTNODE parent, FTNODE child, int
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, ft);
FTNODE newparent, newchild;
toku_pin_ftnode_with_dep_nodes(ft, parent_blocknum, parent_fullhash, &bfe, PL_WRITE_CHEAP, 0, nullptr, &newparent, true);
toku_pin_ftnode(ft, parent_blocknum, parent_fullhash, &bfe, PL_WRITE_CHEAP, &newparent, true);
if (newparent->height != parent_height || childnum >= newparent->n_children) {
// looks like this is the root and it got merged, let's just start over (like in the split case above)
toku_unpin_ftnode_read_only(ft, newparent);
......@@ -2886,7 +2884,7 @@ static void inject_message_at_this_blocknum(FT ft, CACHEKEY cachekey, uint32_t f
FTNODE node;
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, ft);
toku_pin_ftnode_with_dep_nodes(ft, cachekey, fullhash, &bfe, PL_WRITE_CHEAP, 0, NULL, &node, true);
toku_pin_ftnode(ft, cachekey, fullhash, &bfe, PL_WRITE_CHEAP, &node, true);
toku_assert_entire_node_in_memory(node);
paranoid_invariant(node->fullhash==fullhash);
ft_verify_flags(ft, node);
......@@ -3009,11 +3007,11 @@ static void push_something_in_subtree(
if (lock_type == PL_WRITE_CHEAP) {
// We intend to take the write lock for message injection
toku::context inject_ctx(CTX_MESSAGE_INJECTION);
toku_pin_ftnode_with_dep_nodes(ft, child_blocknum, child_fullhash, &bfe, lock_type, 0, nullptr, &child, true);
toku_pin_ftnode(ft, child_blocknum, child_fullhash, &bfe, lock_type, &child, true);
} else {
// We're going to keep promoting
toku::context promo_ctx(CTX_PROMO);
toku_pin_ftnode_with_dep_nodes(ft, child_blocknum, child_fullhash, &bfe, lock_type, 0, nullptr, &child, true);
toku_pin_ftnode(ft, child_blocknum, child_fullhash, &bfe, lock_type, &child, true);
}
} else {
r = toku_maybe_pin_ftnode_clean(ft, child_blocknum, child_fullhash, lock_type, &child);
......@@ -3046,7 +3044,7 @@ static void push_something_in_subtree(
FTNODE newparent;
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, ft); // should be fully in memory, we just split it
toku_pin_ftnode_with_dep_nodes(ft, subtree_root_blocknum, subtree_root_fullhash, &bfe, PL_READ, 0, nullptr, &newparent, true);
toku_pin_ftnode(ft, subtree_root_blocknum, subtree_root_fullhash, &bfe, PL_READ, &newparent, true);
push_something_in_subtree(ft, newparent, -1, msg, flow_deltas, gc_info, depth, loc, true);
return;
}
......@@ -3143,7 +3141,7 @@ void toku_ft_root_put_msg(
// and jump back to here.
change_lock_type:
// get the root node
toku_pin_ftnode_with_dep_nodes(ft, root_key, fullhash, &bfe, lock_type, 0, NULL, &node, true);
toku_pin_ftnode(ft, root_key, fullhash, &bfe, lock_type, &node, true);
toku_assert_entire_node_in_memory(node);
paranoid_invariant(node->fullhash==fullhash);
ft_verify_flags(ft, node);
......@@ -5466,14 +5464,12 @@ toku_ft_search (FT_HANDLE brt, ft_search_t *search, FT_GET_CALLBACK_FUNCTION get
uint32_t fullhash;
CACHEKEY root_key;
toku_calculate_root_offset_pointer(ft, &root_key, &fullhash);
toku_pin_ftnode_with_dep_nodes(
toku_pin_ftnode(
ft,
root_key,
fullhash,
&bfe,
PL_READ, // may_modify_node set to false, because root cannot change during search
0,
NULL,
&node,
true
);
......@@ -6089,14 +6085,12 @@ void toku_ft_keysrange(FT_HANDLE brt, DBT* key_left, DBT* key_right, uint64_t *l
uint32_t fullhash;
CACHEKEY root_key;
toku_calculate_root_offset_pointer(brt->ft, &root_key, &fullhash);
toku_pin_ftnode_with_dep_nodes(
toku_pin_ftnode(
brt->ft,
root_key,
fullhash,
&match_bfe,
PL_READ, // may_modify_node, cannot change root during keyrange
0,
NULL,
&node,
true
);
......@@ -6308,7 +6302,7 @@ int toku_ft_get_key_after_bytes(FT_HANDLE ft_h, const DBT *start_key, uint64_t s
uint32_t fullhash;
CACHEKEY root_key;
toku_calculate_root_offset_pointer(ft, &root_key, &fullhash);
toku_pin_ftnode_with_dep_nodes(ft, root_key, fullhash, &bfe, PL_READ, 0, nullptr, &root, true);
toku_pin_ftnode(ft, root_key, fullhash, &bfe, PL_READ, &root, true);
}
struct unlock_ftnode_extra unlock_extra = {ft_h, root, false};
struct unlockers unlockers = {true, unlock_ftnode_fun, (void*)&unlock_extra, (UNLOCKERS) nullptr};
......@@ -6366,14 +6360,12 @@ toku_dump_ftnode (FILE *file, FT_HANDLE brt, BLOCKNUM blocknum, int depth, const
uint32_t fullhash = toku_cachetable_hash(brt->ft->cf, blocknum);
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_nodes(
toku_pin_ftnode(
brt->ft,
blocknum,
fullhash,
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node,
true
);
......@@ -6567,14 +6559,12 @@ static bool is_empty_fast_iter (FT_HANDLE brt, FTNODE node) {
fill_bfe_for_full_read(&bfe, brt->ft);
// don't need to pass in dependent nodes as we are not
// modifying nodes we are pinning
toku_pin_ftnode_with_dep_nodes(
toku_pin_ftnode(
brt->ft,
childblocknum,
fullhash,
&bfe,
PL_READ, // may_modify_node set to false, as nodes not modified
0,
NULL,
&childnode,
true
);
......@@ -6606,14 +6596,12 @@ bool toku_ft_is_empty_fast (FT_HANDLE brt)
toku_calculate_root_offset_pointer(brt->ft, &root_key, &fullhash);
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_nodes(
toku_pin_ftnode(
brt->ft,
root_key,
fullhash,
&bfe,
PL_READ, // may_modify_node set to false, node does not change
0,
NULL,
&node,
true
);
......
......@@ -254,14 +254,12 @@ toku_pin_node_with_min_bfe(FTNODE* node, BLOCKNUM b, FT_HANDLE t)
{
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_with_dep_nodes(
toku_pin_ftnode(
t->ft,
b,
toku_cachetable_hash(t->ft->cf, b),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
node,
true
);
......
......@@ -297,14 +297,12 @@ toku_get_node_for_verify(
uint32_t fullhash = toku_cachetable_hash(brt->ft->cf, blocknum);
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_nodes(
toku_pin_ftnode(
brt->ft,
blocknum,
fullhash,
&bfe,
PL_WRITE_EXPENSIVE, // may_modify_node
0,
NULL,
nodep,
false
);
......
......@@ -230,15 +230,14 @@ doit (bool after_child_pin) {
FTNODE node = NULL;
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
node_root,
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 1);
assert(node->n_children == 1);
......@@ -249,15 +248,14 @@ doit (bool after_child_pin) {
assert(checkpoint_callback_called);
// now let's pin the root again and make sure it is flushed
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
node_root,
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 1);
assert(node->n_children == 1);
......@@ -286,15 +284,14 @@ doit (bool after_child_pin) {
// now pin the root, verify that we have a message in there, and that it is clean
//
fill_bfe_for_full_read(&bfe, c_ft->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
c_ft->ft,
node_root,
toku_cachetable_hash(c_ft->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 1);
assert(!node->dirty);
......@@ -307,15 +304,14 @@ doit (bool after_child_pin) {
}
toku_unpin_ftnode(c_ft->ft, node);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
c_ft->ft,
node_leaf,
toku_cachetable_hash(c_ft->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 0);
assert(!node->dirty);
......
......@@ -248,7 +248,7 @@ doit (int state) {
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode_with_dep_nodes(
t->ft,
node_root,
toku_cachetable_hash(t->ft->cf, node_root),
......@@ -267,7 +267,7 @@ doit (int state) {
assert(checkpoint_callback_called);
// now let's pin the root again and make sure it is has merged
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode_with_dep_nodes(
t->ft,
node_root,
toku_cachetable_hash(t->ft->cf, node_root),
......@@ -307,7 +307,7 @@ doit (int state) {
// now pin the root, verify that the state is what we expect
//
fill_bfe_for_full_read(&bfe, c_ft->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode_with_dep_nodes(
c_ft->ft,
node_root,
toku_cachetable_hash(c_ft->ft->cf, node_root),
......@@ -338,7 +338,7 @@ doit (int state) {
// now let's verify the leaves are what we expect
if (state == flt_flush_before_merge || state == flt_flush_before_pin_second_node_for_merge) {
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode_with_dep_nodes(
c_ft->ft,
left_child,
toku_cachetable_hash(c_ft->ft->cf, left_child),
......@@ -355,7 +355,7 @@ doit (int state) {
assert(BLB_DATA(node, 0)->omt_size() == 1);
toku_unpin_ftnode(c_ft->ft, node);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode_with_dep_nodes(
c_ft->ft,
right_child,
toku_cachetable_hash(c_ft->ft->cf, right_child),
......@@ -373,7 +373,7 @@ doit (int state) {
toku_unpin_ftnode(c_ft->ft, node);
}
else if (state == ft_flush_aflter_merge || state == flt_flush_before_unpin_remove) {
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode_with_dep_nodes(
c_ft->ft,
left_child,
toku_cachetable_hash(c_ft->ft->cf, left_child),
......
......@@ -268,14 +268,12 @@ doit (int state) {
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
node_root,
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node,
true
);
......@@ -287,14 +285,12 @@ doit (int state) {
assert(checkpoint_callback_called);
// now let's pin the root again and make sure it is has rebalanced
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
node_root,
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node,
true
);
......@@ -327,15 +323,14 @@ doit (int state) {
// now pin the root, verify that the state is what we expect
//
fill_bfe_for_full_read(&bfe, c_ft->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
c_ft->ft,
node_root,
toku_cachetable_hash(c_ft->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 1);
assert(!node->dirty);
......@@ -348,15 +343,14 @@ doit (int state) {
toku_unpin_ftnode(c_ft->ft, node);
// now let's verify the leaves are what we expect
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
c_ft->ft,
left_child,
toku_cachetable_hash(c_ft->ft->cf, left_child),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 0);
assert(!node->dirty);
......@@ -364,15 +358,14 @@ doit (int state) {
assert(BLB_DATA(node, 0)->omt_size() == 2);
toku_unpin_ftnode(c_ft->ft, node);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
c_ft->ft,
right_child,
toku_cachetable_hash(c_ft->ft->cf, right_child),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 0);
assert(!node->dirty);
......
......@@ -244,15 +244,14 @@ doit (bool after_split) {
FTNODE node = NULL;
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
node_root,
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 1);
assert(node->n_children == 1);
......@@ -262,15 +261,14 @@ doit (bool after_split) {
assert(checkpoint_callback_called);
// now let's pin the root again and make sure it is has split
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
node_root,
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 1);
assert(node->n_children == 2);
......@@ -301,15 +299,14 @@ doit (bool after_split) {
// now pin the root, verify that we have a message in there, and that it is clean
//
fill_bfe_for_full_read(&bfe, c_ft->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
c_ft->ft,
node_root,
toku_cachetable_hash(c_ft->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 1);
assert(!node->dirty);
......@@ -329,15 +326,14 @@ doit (bool after_split) {
// now let's verify the leaves are what we expect
if (after_split) {
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
c_ft->ft,
left_child,
toku_cachetable_hash(c_ft->ft->cf, left_child),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 0);
assert(!node->dirty);
......@@ -345,15 +341,14 @@ doit (bool after_split) {
assert(BLB_DATA(node, 0)->omt_size() == 1);
toku_unpin_ftnode(c_ft->ft, node);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
c_ft->ft,
right_child,
toku_cachetable_hash(c_ft->ft->cf, right_child),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 0);
assert(!node->dirty);
......@@ -362,15 +357,14 @@ doit (bool after_split) {
toku_unpin_ftnode(c_ft->ft, node);
}
else {
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
c_ft->ft,
left_child,
toku_cachetable_hash(c_ft->ft->cf, left_child),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 0);
assert(!node->dirty);
......
......@@ -240,7 +240,7 @@ doit (void) {
FTNODE node = NULL;
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode_with_dep_nodes(
brt->ft,
node_leaf,
toku_cachetable_hash(brt->ft->cf, node_leaf),
......@@ -270,7 +270,7 @@ doit (void) {
// on disk
//
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode_with_dep_nodes(
brt->ft,
node_leaf,
toku_cachetable_hash(brt->ft->cf, node_leaf),
......@@ -291,7 +291,7 @@ doit (void) {
// now let us induce a clean on the internal node
//
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode_with_dep_nodes(
brt->ft,
node_internal,
toku_cachetable_hash(brt->ft->cf, node_internal),
......@@ -316,7 +316,7 @@ doit (void) {
// verify that node_internal's buffer is empty
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode_with_dep_nodes(
brt->ft,
node_internal,
toku_cachetable_hash(brt->ft->cf, node_internal),
......
......@@ -246,15 +246,14 @@ doit (bool keep_other_bn_in_memory) {
FTNODE node = NULL;
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
brt->ft,
node_leaf,
toku_cachetable_hash(brt->ft->cf, node_leaf),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(!node->dirty);
assert(node->n_children == 2);
......@@ -293,15 +292,14 @@ doit (bool keep_other_bn_in_memory) {
//
fill_bfe_for_min_read(&bfe, brt->ft);
}
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
brt->ft,
node_leaf,
toku_cachetable_hash(brt->ft->cf, node_leaf),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(!node->dirty);
assert(node->n_children == 2);
......@@ -318,15 +316,14 @@ doit (bool keep_other_bn_in_memory) {
// now let us induce a clean on the internal node
//
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
brt->ft,
node_internal,
toku_cachetable_hash(brt->ft->cf, node_internal),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(!node->dirty);
......@@ -342,15 +339,14 @@ doit (bool keep_other_bn_in_memory) {
// verify that node_internal's buffer is empty
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
brt->ft,
node_internal,
toku_cachetable_hash(brt->ft->cf, node_internal),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
// check that buffers are empty
assert(toku_bnc_nbytesinbuf(BNC(node, 0)) == 0);
......
......@@ -183,15 +183,14 @@ doit (void) {
FTNODE node = NULL;
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
node_root,
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 1);
assert(node->n_children == 3);
......@@ -213,15 +212,14 @@ doit (void) {
// only the middle buffer, let's verify this.
node = NULL;
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
node_root,
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 1);
assert(node->n_children == 3);
......
......@@ -232,15 +232,14 @@ doit (void) {
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
brt->ft,
node_internal,
toku_cachetable_hash(brt->ft->cf, node_internal),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->n_children == 2);
// we expect that this flushes its buffer, that
......@@ -255,15 +254,14 @@ doit (void) {
// verify that node_internal's buffer is empty
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
brt->ft,
node_internal,
toku_cachetable_hash(brt->ft->cf, node_internal),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
// check that merge happened
assert(node->n_children == 1);
......
......@@ -169,15 +169,14 @@ static void test_oldest_referenced_xid_gets_propogated(void) {
FTNODE node = NULL;
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
child_nonleaf_blocknum,
toku_cachetable_hash(t->ft->cf, child_nonleaf_blocknum),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 1);
assert(node->n_children == 1);
......@@ -186,15 +185,14 @@ static void test_oldest_referenced_xid_gets_propogated(void) {
toku_unpin_ftnode(t->ft, node);
// now verify the root - keep it pinned so we can flush it below
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
root_blocknum,
toku_cachetable_hash(t->ft->cf, root_blocknum),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->height == 2);
assert(node->n_children == 1);
......@@ -222,15 +220,14 @@ static void test_oldest_referenced_xid_gets_propogated(void) {
// pin the child, verify that oldest referenced xid was
// propogated from parent to child during the flush
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
child_nonleaf_blocknum,
toku_cachetable_hash(t->ft->cf, child_nonleaf_blocknum),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->oldest_referenced_xid_known == flush_xid);
......
......@@ -150,15 +150,14 @@ doit (void) {
FTNODE node;
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, t->ft);
toku_pin_ftnode_with_dep_pairs(
toku_pin_ftnode(
t->ft,
node_internal,
toku_cachetable_hash(t->ft->cf, node_internal),
&bfe,
PL_WRITE_EXPENSIVE,
0,
NULL,
&node
&node,
true
);
assert(node->n_children == 1);
// simply assert that the buffer is less than 50MB,
......
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