From 0ab263b32967834fb209d4cf660fae0b56143965 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 27 Dec 2020 20:42:11 +0300 Subject: [PATCH] mdbx: purge deleted spilled pagenums on refund. Change-Id: I325fbad82cbecb71c35dd1edd1a2abccb8108541 --- src/core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index 3b1ed00c..1986c963 100644 --- a/src/core.c +++ b/src/core.c @@ -4030,7 +4030,14 @@ static bool mdbx_refund(MDBX_txn *txn) { break; } - return before != txn->mt_next_pgno; + if (before == txn->mt_next_pgno) + return false; + + if (txn->tw.spill_pages) + /* Squash deleted pagenums if we refunded any */ + mdbx_pnl_purge_odd(txn->tw.spill_pages, 1); + + return true; } static __cold void mdbx_kill_page(MDBX_env *env, MDBX_page *mp, pgno_t pgno,