From 116a6a8cfedd56fa094a715d5e5f644a41b32694 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 2 Dec 2019 20:30:37 +0300 Subject: [PATCH] mdbx: don't create steady-checkpoint for db-shrink in utterly-unsync mode without prev steady-points. Change-Id: I1ec0d6cb9c31af0d151964d06d390ec247c2ac41 --- src/elements/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/elements/core.c b/src/elements/core.c index 4896dc50..b969bfb9 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -7459,7 +7459,9 @@ static int mdbx_sync_locked(MDBX_env *env, unsigned flags, const pgno_t bottom = (aligned > pending->mm_geo.lower) ? aligned : pending->mm_geo.lower; if (pending->mm_geo.now > bottom) { - flags &= MDBX_WRITEMAP | MDBX_SHRINK_ALLOWED; /* force steady */ + if (META_IS_STEADY(mdbx_meta_steady(env))) + /* force steady, but only if steady-checkpoint is present */ + flags &= MDBX_WRITEMAP | MDBX_SHRINK_ALLOWED; shrink = pending->mm_geo.now - bottom; pending->mm_geo.now = bottom; if (mdbx_meta_txnid_stable(env, head) ==