mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-20 06:08:21 +08:00
mdbx-test: fix for MDBX_BAD_TXN in case txn auto-cancelled during commit.
Change-Id: I1fafed6f6ac55de171d24947039f37eb4cb384a9
This commit is contained in:
parent
a6aad9c918
commit
7ed1586ea6
@ -105,7 +105,8 @@ bool testcase_nested::pop_txn(bool abort) {
|
|||||||
should_continue = false;
|
should_continue = false;
|
||||||
if (err == MDBX_MAP_FULL && config.params.ignore_dbfull) {
|
if (err == MDBX_MAP_FULL && config.params.ignore_dbfull) {
|
||||||
err = mdbx_txn_abort(txn);
|
err = mdbx_txn_abort(txn);
|
||||||
if (unlikely(err != MDBX_SUCCESS && err != MDBX_THREAD_MISMATCH))
|
if (unlikely(err != MDBX_SUCCESS && err != MDBX_THREAD_MISMATCH &&
|
||||||
|
err != MDBX_BAD_TXN))
|
||||||
failure_perror("mdbx_txn_abort()", err);
|
failure_perror("mdbx_txn_abort()", err);
|
||||||
} else
|
} else
|
||||||
failure_perror("mdbx_txn_commit()", err);
|
failure_perror("mdbx_txn_commit()", err);
|
||||||
|
@ -189,7 +189,8 @@ int testcase::breakable_commit() {
|
|||||||
if (err == MDBX_MAP_FULL && config.params.ignore_dbfull) {
|
if (err == MDBX_MAP_FULL && config.params.ignore_dbfull) {
|
||||||
rc = err;
|
rc = err;
|
||||||
err = mdbx_txn_abort(txn);
|
err = mdbx_txn_abort(txn);
|
||||||
if (unlikely(err != MDBX_SUCCESS && err != MDBX_THREAD_MISMATCH))
|
if (unlikely(err != MDBX_SUCCESS && err != MDBX_THREAD_MISMATCH &&
|
||||||
|
err != MDBX_BAD_TXN))
|
||||||
failure_perror("mdbx_txn_abort()", err);
|
failure_perror("mdbx_txn_abort()", err);
|
||||||
} else
|
} else
|
||||||
failure_perror("mdbx_txn_commit()", err);
|
failure_perror("mdbx_txn_commit()", err);
|
||||||
@ -220,7 +221,8 @@ void testcase::txn_end(bool abort) {
|
|||||||
MDBX_txn *txn = txn_guard.release();
|
MDBX_txn *txn = txn_guard.release();
|
||||||
if (abort) {
|
if (abort) {
|
||||||
int err = mdbx_txn_abort(txn);
|
int err = mdbx_txn_abort(txn);
|
||||||
if (unlikely(err != MDBX_SUCCESS && err != MDBX_THREAD_MISMATCH))
|
if (unlikely(err != MDBX_SUCCESS && err != MDBX_THREAD_MISMATCH &&
|
||||||
|
err != MDBX_BAD_TXN))
|
||||||
failure_perror("mdbx_txn_abort()", err);
|
failure_perror("mdbx_txn_abort()", err);
|
||||||
} else {
|
} else {
|
||||||
txn_inject_writefault(txn);
|
txn_inject_writefault(txn);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user