From 02da29fd050ef08cd21416d0d0d1088fc8ea1ed7 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 26 Aug 2021 18:23:40 +0300 Subject: [PATCH] btree: Destroy, not drop, node on clone roll-back The node in this place is not yet attached to its parent, so in btree::debug::yes (tests only) mode the node::drop()'s parent checks will access null parent pointer. However, in non-tesing runtime there's a chance that a linear node fails to clone one of its keys and gets here. In this case it will carry both leftmost and rightmost flags and the assertion in drop will fire. Signed-off-by: Pavel Emelyanov (cherry picked from commit 1d857d604ac73bfbf2ba5eef72f8c44b98ef1bf7) Ref #9248. --- utils/intrusive_btree.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/intrusive_btree.hh b/utils/intrusive_btree.hh index 71b55d348f..a5a9c5c6c8 100644 --- a/utils/intrusive_btree.hh +++ b/utils/intrusive_btree.hh @@ -2082,7 +2082,7 @@ private: n->_kids[ni - 1]->clear([&deleter] (member_hook* h) { node::dispose_key(h, deleter); }); destroy(*n->_kids[--ni]); } - n->drop(); + destroy(*n); throw; }