From f75fa27fe60837e88a634111508dc555f3eeafaf Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Wed, 15 Feb 2017 20:54:58 +0300 Subject: [PATCH] mdbx: don't close DBI-handles from R/O txn_abort(). This is related to: - https://github.com/ReOpen/ReOpenLDAP/issues/119 (its6794 regression test may fail) - https://github.com/ReOpen/ReOpenLDAP/issues/92 (rare test060-mt-hot failures) --- mdb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mdb.c b/mdb.c index 8edd5e5b..cf4a3e2d 100644 --- a/mdb.c +++ b/mdb.c @@ -3256,6 +3256,12 @@ mdb_txn_abort(MDB_txn *txn) if(unlikely(txn->mt_signature != MDBX_MT_SIGNATURE)) return MDB_VERSION_MISMATCH; +#if MDBX_MODE_ENABLED + if (F_ISSET(txn->mt_flags, MDB_TXN_RDONLY)) + /* LY: don't close DBI-handles in MDBX mode */ + return mdb_txn_end(txn, MDB_END_UPDATE|MDB_END_SLOT|MDB_END_FREE); +#endif /* MDBX_MODE_ENABLED */ + if (txn->mt_child) mdb_txn_abort(txn->mt_child);