mdbx: don't close/lost DBI-handles on ro-txn renew/reset.

More for d0383e5aeeb29fc07b568a0d4b5287d539be5d0d

Also 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)
This commit is contained in:
Leo Yuriev 2017-02-16 14:15:47 +03:00
parent 41576e553c
commit 1708025651
2 changed files with 7 additions and 2 deletions

7
mdb.c
View File

@ -3244,7 +3244,12 @@ mdb_txn_reset(MDB_txn *txn)
if (unlikely(!(txn->mt_flags & MDB_TXN_RDONLY)))
return EINVAL;
#if MDBX_MODE_ENABLED
/* LY: don't close DBI-handles in MDBX mode */
return mdb_txn_end(txn, MDB_END_RESET|MDB_END_UPDATE);
#else
return mdb_txn_end(txn, MDB_END_RESET);
#endif /* MDBX_MODE_ENABLED */
}
int
@ -3259,7 +3264,7 @@ mdb_txn_abort(MDB_txn *txn)
#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);
return mdb_txn_end(txn, MDB_END_ABORT|MDB_END_UPDATE|MDB_END_SLOT|MDB_END_FREE);
#endif /* MDBX_MODE_ENABLED */
if (txn->mt_child)

2
mdbx.c
View File

@ -369,7 +369,7 @@ int mdbx_cursor_on_first(MDB_cursor *mc)
for(i = 0; i < mc->mc_snum; ++i) {
if (mc->mc_ki[i])
return MDBX_RESULT_FALSE;
}
}
return MDBX_RESULT_TRUE;
}