mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
refs #5861 fix the bug on mainline
git-svn-id: file:///svn/toku/tokudb@51529 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
0d80171a74
commit
69910da437
1 changed files with 10 additions and 10 deletions
20
ft/ft-ops.cc
20
ft/ft-ops.cc
|
@ -2693,19 +2693,19 @@ static bool process_maybe_reactive_child(FT ft, FTNODE parent, FTNODE child, int
|
|||
child_fullhash = compute_child_fullhash(ft->cf, newparent, childnum);
|
||||
toku_pin_ftnode_off_client_thread_batched(ft, child_blocknum, child_fullhash, &bfe, PL_READ, 1, &newparent, &newchild);
|
||||
newre = get_node_reactivity(newchild, ft->h->nodesize);
|
||||
if (newre == RE_FUSIBLE) {
|
||||
if (newparent->n_children < 2) {
|
||||
// weird case where newparent is the root node and
|
||||
// can't merge, so it might only have one child. In
|
||||
// this case, just return false so we can insert
|
||||
// anyway.
|
||||
return false;
|
||||
}
|
||||
if (newre == RE_FUSIBLE && newparent->n_children >= 2) {
|
||||
toku_unpin_ftnode_read_only(ft, newchild);
|
||||
toku_ft_merge_child(ft, newparent, childnum);
|
||||
} else {
|
||||
// some other thread already got it, just unpin and tell the
|
||||
// caller to retry
|
||||
// Could be a weird case where newparent has only one
|
||||
// child. In this case, we want to inject here but we've
|
||||
// already unpinned the caller's copy of parent so we have
|
||||
// to ask them to re-pin, or they could (very rarely)
|
||||
// dereferenced memory in a freed node. TODO: we could
|
||||
// give them back the copy of the parent we pinned.
|
||||
//
|
||||
// Otherwise, some other thread already got it, just unpin
|
||||
// and tell the caller to retry
|
||||
toku_unpin_ftnode_read_only(ft, newchild);
|
||||
toku_unpin_ftnode_read_only(ft, newparent);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue