From ad091646046c29ca66e35cc45156b490ee76d8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sat, 8 Oct 2022 17:29:29 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20=D0=BC=D0=B8=D0=BD=D0=BE=D1=80=D0=BD?= =?UTF-8?q?=D0=BE=D0=B5=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BB=D1=8F=20=D1=83=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=81=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=B0=D1=82=D1=8B=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BE=D1=87=D0=BD=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D1=83=D1=82=D0=B2=D0=B5=D1=80=D0=B6=D0=B4=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B2=20=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D0=BE?= =?UTF-8?q?=D1=87=D0=BD=D1=8B=D1=85=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B0?= =?UTF-8?q?=D1=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ассерт мог срабатывать из-за отсутствия бита P_LEAF2 в передаваемом проверочном значении. На что-либо другое не влияло, но не следует понять почему этот недочет ны был выявлен тестами раньше. --- src/core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core.c b/src/core.c index 2e726664..12e7bd8a 100644 --- a/src/core.c +++ b/src/core.c @@ -4127,8 +4127,8 @@ static int page_retire_ex(MDBX_cursor *mc, const pgno_t pgno, check = page_get_any(mc, pgno, txn->mt_front); if (unlikely(check.err != MDBX_SUCCESS)) return check.err; - tASSERT(txn, (check.page->mp_flags & ~(P_LEAF2 | P_SPILLED)) == - (pageflags & ~P_FROZEN)); + tASSERT(txn, + (check.page->mp_flags & ~P_SPILLED) == (pageflags & ~P_FROZEN)); tASSERT(txn, !(pageflags & P_FROZEN) || IS_FROZEN(txn, check.page)); } if (pageflags & P_FROZEN) { @@ -21483,9 +21483,10 @@ static int drop_tree(MDBX_cursor *mc, const bool may_have_subDBs) { } else { cASSERT(mc, mc->mc_snum < mc->mc_db->md_depth); mc->mc_checking |= CC_RETIRING; - const unsigned pagetype = - (IS_FROZEN(txn, mp) ? P_FROZEN : 0) + - ((mc->mc_snum + 1 == mc->mc_db->md_depth) ? P_LEAF : P_BRANCH); + const unsigned pagetype = (IS_FROZEN(txn, mp) ? P_FROZEN : 0) + + ((mc->mc_snum + 1 == mc->mc_db->md_depth) + ? (mc->mc_checking & (P_LEAF | P_LEAF2)) + : P_BRANCH); for (size_t i = 0; i < nkeys; i++) { MDBX_node *node = page_node(mp, i); tASSERT(txn, (node_flags(node) &