mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-09 01:54:12 +08:00
mdbx: backport - fix reclaiming_detent() for out-of-txn case.
Change-Id: I5275f4f3676b125e860f6a7c204a5f9cdc65dd5f
This commit is contained in:
parent
78e354689e
commit
b357897745
@ -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) {
|
static __hot txnid_t mdbx_reclaiming_detent(const MDBX_env *env) {
|
||||||
if (F_ISSET(env->me_flags, MDBX_UTTERLY_NOSYNC))
|
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));
|
return mdbx_meta_txnid_stable(env, mdbx_meta_steady(env));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user