From 3d53f2ff2a4859c3f35e0ded8038bda86c440a8e Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Mon, 24 Jul 2017 13:31:06 +0300 Subject: [PATCH] mdbx: refine mdbx_reclaiming_detent() for MDBX_UTTERLY_NOSYNC. Change-Id: I7847f2b375f3792927a55c90bb26d3220e71b576 --- src/mdbx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mdbx.c b/src/mdbx.c index 504811f8..c2243dbb 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -1494,8 +1494,10 @@ static __hot MDBX_meta *mdbx_meta_head(const MDBX_env *env) { } static __hot txnid_t mdbx_reclaiming_detent(const MDBX_env *env) { - MDBX_meta *meta = mdbx_meta_mostrecent(prefer_noweak, env); - return mdbx_meta_txnid_stable(env, meta); + if (F_ISSET(env->me_flags, MDBX_UTTERLY_NOSYNC)) + return env->me_txn->mt_txnid - 1; + + return mdbx_meta_txnid_stable(env, mdbx_meta_steady(env)); } static const char *mdbx_durable_str(const MDBX_meta *const meta) {