mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
Fixed nbo_meta handling, release commit order for NBO begin.
This commit is contained in:
@ -522,7 +522,7 @@ int wsrep::client_state::enter_nbo_mode(const wsrep::ws_meta& ws_meta)
|
||||
assert(state_ == s_exec);
|
||||
assert(mode_ == m_local);
|
||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||
toi_meta_ = ws_meta;
|
||||
nbo_meta_ = ws_meta;
|
||||
toi_mode_ = mode_;
|
||||
mode(lock, m_nbo);
|
||||
return 0;
|
||||
@ -533,8 +533,13 @@ int wsrep::client_state::begin_nbo_phase_two()
|
||||
debug_log_state("begin_nbo_phase_two: enter");
|
||||
assert(state_ == s_exec);
|
||||
assert(mode_ == m_nbo);
|
||||
assert(!in_toi());
|
||||
|
||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||
// Note: nbo_meta_ is passed to enter_toi() as it is
|
||||
// an input param containing gtid of NBO begin.
|
||||
// Output stored in nbo_meta_ is copied to toi_meta_ for
|
||||
// phase two end.
|
||||
enum wsrep::provider::status status(
|
||||
provider().enter_toi(id_, wsrep::key_array(),
|
||||
wsrep::const_buffer(), nbo_meta_,
|
||||
@ -544,6 +549,7 @@ int wsrep::client_state::begin_nbo_phase_two()
|
||||
{
|
||||
case wsrep::provider::success:
|
||||
ret= 0;
|
||||
toi_meta_ = nbo_meta_;
|
||||
break;
|
||||
default:
|
||||
current_error_status_ = status;
|
||||
@ -652,7 +658,8 @@ void wsrep::client_state::debug_log_state(const char* context) const
|
||||
<< "," << to_c_string(state_)
|
||||
<< "," << to_c_string(mode_)
|
||||
<< "," << wsrep::to_string(current_error_)
|
||||
<< ")");
|
||||
<< ",toi: " << toi_meta_.seqno()
|
||||
<< ",nbo: " << nbo_meta_.seqno() << ")");
|
||||
}
|
||||
|
||||
void wsrep::client_state::state(
|
||||
|
@ -472,6 +472,8 @@ static int apply_toi(wsrep::provider& provider,
|
||||
{
|
||||
// NBO end event is ignored here, both local and applied
|
||||
// have NBO end handled via local TOI calls.
|
||||
provider.commit_order_enter(ws_handle, ws_meta);
|
||||
provider.commit_order_leave(ws_handle, ws_meta);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user