From 4ee8fff30547b97569ac482b39dea27f4baeaecf 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: Fri, 9 Dec 2022 19:18:17 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20+1=20=D0=BA=20=D0=BF=D0=BE=D0=B4=D0=B3?= =?UTF-8?q?=D0=BE=D1=82=D0=B0=D0=B2=D0=BB=D0=B8=D0=B2=D0=B0=D0=B5=D0=BC?= =?UTF-8?q?=D0=BE=D0=BC=D1=83=20=D1=80=D0=B5=D0=B7=D0=B5=D1=80=D0=B2=D1=83?= =?UTF-8?q?=20=D0=B2=20=D0=B2=D1=8B=D1=80=D0=BE=D0=B6=D0=B4=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D1=81=D0=BB=D1=83=D1=87=D0=B0=D1=8F=D1=85?= =?UTF-8?q?=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=20=D0=BE=D0=B1=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC=20GC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index 0bb42154..db00fc66 100644 --- a/src/core.c +++ b/src/core.c @@ -9927,7 +9927,9 @@ static int gcu_touch(gcu_context_t *ctx) { * during a deleting, when GC tree is unbalanced. */ static int gcu_prepare_backlog(MDBX_txn *txn, gcu_context_t *ctx) { const size_t for_cow = txn->mt_dbs[FREE_DBI].md_depth; - const size_t for_rebalance = for_cow + 1; + const size_t for_rebalance = for_cow + 1 + + (txn->mt_dbs[FREE_DBI].md_depth + 1ul >= + txn->mt_dbs[FREE_DBI].md_branch_pages); size_t for_split = ctx->retired_stored == 0; const intptr_t retired_left =