mdbx: backport - fix reclaiming_detent() for out-of-txn case.

Change-Id: I5275f4f3676b125e860f6a7c204a5f9cdc65dd5f
This commit is contained in:
Leonid Yuriev 2019-08-23 17:47:38 +03:00
parent 78e354689e
commit b357897745

View File

@ -1875,7 +1875,9 @@ static __hot MDBX_meta *mdbx_meta_head(const MDBX_env *env) {
static __hot txnid_t mdbx_reclaiming_detent(const MDBX_env *env) {
if (F_ISSET(env->me_flags, MDBX_UTTERLY_NOSYNC))
return env->me_txn->mt_txnid - 1;
return likely(env->me_txn0->mt_owner == mdbx_thread_self())
? env->me_txn0->mt_txnid - 1
: mdbx_meta_txnid_fluid(env, mdbx_meta_head(env));
return mdbx_meta_txnid_stable(env, mdbx_meta_steady(env));
}