1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Address review comments

* Added unit tests for transaction::xa_detach() and
  transaction::xa_replay()
* Added unit tests for wsrep::xid
* Fixed minor issues pointed out by reviewer
This commit is contained in:
Daniele Sciascia
2020-09-30 17:48:53 +02:00
parent 39e37d3a39
commit 6752a4504f
12 changed files with 239 additions and 20 deletions

View File

@ -1429,9 +1429,10 @@ void wsrep::server_state::recover_streaming_appliers_if_not_recovered(
class transaction_state_cmp
{
public:
transaction_state_cmp(const enum wsrep::transaction::state s) : state_(s)
{ }
bool operator()(std::pair<const wsrep::client_id, wsrep::client_state*>& vt) const
transaction_state_cmp(const enum wsrep::transaction::state s)
: state_(s) { }
bool operator()(const std::pair<wsrep::client_id,
wsrep::client_state*>& vt) const
{
return vt.second->transaction().state() == state_;
}

View File

@ -1071,6 +1071,13 @@ void wsrep::transaction::clone_for_replay(const wsrep::transaction& other)
state_ = s_replaying;
}
void wsrep::transaction::assign_xid(const wsrep::xid& xid)
{
assert(active());
assert(!is_xa());
xid_ = xid;
}
int wsrep::transaction::restore_to_prepared_state(const wsrep::xid& xid)
{
wsrep::unique_lock<wsrep::mutex> lock(client_state_.mutex_);