From 4277f1065fee3fe1a36104f0675a2b9440a3ae19 Mon Sep 17 00:00:00 2001 From: dangzhonghua Date: Mon, 23 Sep 2019 19:03:17 +0800 Subject: [PATCH] Issue #5842: write prepare policy, before XA commit, shutdown will core --- utilities/transactions/write_prepared_txn_db.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utilities/transactions/write_prepared_txn_db.h b/utilities/transactions/write_prepared_txn_db.h index fdeaf879e..80070d240 100644 --- a/utilities/transactions/write_prepared_txn_db.h +++ b/utilities/transactions/write_prepared_txn_db.h @@ -527,9 +527,12 @@ class WritePreparedTxnDB : public PessimisticTransactionDB { public: ~PreparedHeap() { - if (!TEST_CRASH_) { - assert(heap_.empty()); - assert(erased_heap_.empty()); + /* + Assert prepared_txns_ is empty is ideal case. In XA + transactions scenario the prepared_txns_ is non-empty since some + transactions are not committed but be prepared. So the assert is + disabled. + */ } } port::Mutex* push_pop_mutex() { return &push_pop_mutex_; }