mdbx: refine page_flush().

Change-Id: I8270226e4eae721404dbb56d5d591bceaa4613b9
This commit is contained in:
Leonid Yuriev 2019-12-19 00:48:14 +03:00
parent 7f9502fbfe
commit edbdb682d5

View File

@ -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;
}
}