From edbdb682d5891d01c5de27548415a2bb4d82dd82 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 19 Dec 2019 00:48:14 +0300 Subject: [PATCH] mdbx: refine page_flush(). Change-Id: I8270226e4eae721404dbb56d5d591bceaa4613b9 --- src/elements/core.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/elements/core.c b/src/elements/core.c index 695c1dfe..0265223d 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -6595,11 +6595,15 @@ __hot static int mdbx_page_flush(MDBX_txn *txn, const unsigned keep) { mdbx_tassert(txn, dp->mp_flags & P_DIRTY); /* Don't flush this page yet */ - if (dp->mp_flags & (P_LOOSE | P_KEEP)) { + if (dp->mp_flags & P_KEEP) { dp->mp_flags &= ~P_KEEP; dl[++w] = dl[r]; continue; } + if (dp->mp_flags & P_LOOSE) { + dl[++w] = dl[r]; + continue; + } const unsigned npages = IS_OVERFLOW(dp) ? dp->mp_pages : 1; flush_begin = (flush_begin < dp->mp_pgno) ? flush_begin : dp->mp_pgno; @@ -7671,7 +7675,7 @@ static int mdbx_sync_locked(MDBX_env *env, unsigned flags, if (unlikely(rc != MDBX_SUCCESS)) goto fail; #endif /* MacOS */ - *env->me_meta_sync_txnid = (uint32_t)pending->mm_txnid_a.inconsistent; + *env->me_meta_sync_txnid = pending->mm_txnid_a.low; } } } else { @@ -7697,7 +7701,7 @@ static int mdbx_sync_locked(MDBX_env *env, unsigned flags, if (rc != MDBX_SUCCESS) goto undo; } - *env->me_meta_sync_txnid = (uint32_t)pending->mm_txnid_a.inconsistent; + *env->me_meta_sync_txnid = pending->mm_txnid_a.low; } }