From b30ccbde9e5210b68a6ba0570a8716f59655d010 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 25 Dec 2021 15:25:25 +0300 Subject: [PATCH] mdbx: don't reserve/backlog free-pages if retired-list was already put into gc. --- src/core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core.c b/src/core.c index 766bd2c7..a552d2aa 100644 --- a/src/core.c +++ b/src/core.c @@ -8768,10 +8768,12 @@ retry_noaccount: goto bailout; } - rc = mdbx_prep_backlog(txn, &couple.outer, - MDBX_PNL_SIZEOF(txn->tw.retired_pages)); - if (unlikely(rc != MDBX_SUCCESS)) - goto bailout; + if (retired_stored < MDBX_PNL_SIZE(txn->tw.retired_pages)) { + rc = mdbx_prep_backlog(txn, &couple.outer, + MDBX_PNL_SIZEOF(txn->tw.retired_pages)); + if (unlikely(rc != MDBX_SUCCESS)) + goto bailout; + } unsigned settled = 0, cleaned_gc_slot = 0, reused_gc_slot = 0, filled_gc_slot = ~0u;