Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
temeo committed May 16, 2023
1 parent b76e94f commit e238c0d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions src/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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() &&
Expand Down Expand Up @@ -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");
}

Expand Down
2 changes: 0 additions & 2 deletions test/mock_client_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit e238c0d

Please sign in to comment.