From ce9c4acea6d5c58eb6aa1a8efef4f8256e8f072e Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Sun, 23 Apr 2017 18:59:16 +0300 Subject: [PATCH] mdbx: fix mdbg_canary_put(). Change-Id: I36917a686b28405ed7ecd07dbeb1b4d517720410 --- src/mdbx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mdbx.c b/src/mdbx.c index 3ed4c46d..cfca3b5a 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -9787,7 +9787,12 @@ int mdbx_canary_put(MDB_txn *txn, const mdbx_canary *canary) { txn->mt_canary.z = canary->z; } txn->mt_canary.v = txn->mt_txnid; - txn->mt_flags |= MDB_TXN_DIRTY; + + if ((txn->mt_flags & MDB_TXN_DIRTY) == 0) { + MDB_env *env = txn->mt_env; + txn->mt_flags |= MDB_TXN_DIRTY; + env->me_sync_pending += env->me_psize; + } return MDB_SUCCESS; }