From e238c0d240c2557229b0523a4a032f3cf8b41639 Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Tue, 16 May 2023 19:16:55 +0300 Subject: [PATCH] Review fixes * Move resetting is_bf_immutable_ into trasaction::cleanup() to ensure that it is reset to false regardless how the transaction terminates. * Removed redundant lock()/unlock() methods from mock_client_state. --- src/transaction.cpp | 3 +-- test/mock_client_state.hpp | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/transaction.cpp b/src/transaction.cpp index df76110..1783bd4 100644 --- a/src/transaction.cpp +++ b/src/transaction.cpp @@ -648,7 +648,6 @@ int wsrep::transaction::after_commit() } assert(ret == 0); state(lock, s_committed); - is_bf_immutable_ = false; debug_log_state("after_commit_leave"); return ret; } @@ -828,7 +827,6 @@ int wsrep::transaction::after_statement() state() == s_must_abort || state() == s_cert_failed || state() == s_must_replay); - assert(not is_bf_immutable_); if (state() == s_executing && streaming_context_.fragment_size() && @@ -2110,6 +2108,7 @@ void wsrep::transaction::cleanup() client_service_.cleanup_transaction(); apply_error_buf_.clear(); xid_.clear(); + is_bf_immutable_ = false; debug_log_state("cleanup_leave"); } diff --git a/test/mock_client_state.hpp b/test/mock_client_state.hpp index 4102e1d..73b2775 100644 --- a/test/mock_client_state.hpp +++ b/test/mock_client_state.hpp @@ -49,8 +49,6 @@ namespace wsrep (void)client_service().bf_rollback(); } } - void lock() { mutex_.lock(); } - void unlock() { mutex_.unlock(); } private: wsrep::default_mutex mutex_; wsrep::default_condition_variable cond_;