From 7ed1586ea6e89f69763d4ca8f9592db77d499d96 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 10 Oct 2019 15:24:39 +0300 Subject: [PATCH] mdbx-test: fix for MDBX_BAD_TXN in case txn auto-cancelled during commit. Change-Id: I1fafed6f6ac55de171d24947039f37eb4cb384a9 --- test/nested.cc | 3 ++- test/test.cc | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/nested.cc b/test/nested.cc index 75999598..dbad4500 100644 --- a/test/nested.cc +++ b/test/nested.cc @@ -105,7 +105,8 @@ bool testcase_nested::pop_txn(bool abort) { should_continue = false; if (err == MDBX_MAP_FULL && config.params.ignore_dbfull) { 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); } else failure_perror("mdbx_txn_commit()", err); diff --git a/test/test.cc b/test/test.cc index 73e32c8c..806e0b3c 100644 --- a/test/test.cc +++ b/test/test.cc @@ -189,7 +189,8 @@ int testcase::breakable_commit() { if (err == MDBX_MAP_FULL && config.params.ignore_dbfull) { rc = err; 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); } else failure_perror("mdbx_txn_commit()", err); @@ -220,7 +221,8 @@ void testcase::txn_end(bool abort) { MDBX_txn *txn = txn_guard.release(); if (abort) { 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); } else { txn_inject_writefault(txn);