mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
Relaxed server_state state transition sanity checks
In release build log a warning but continue with state transition anyway. In debug build log warning and crash in assert.
This commit is contained in:
@ -1093,28 +1093,25 @@ void wsrep::server_state::state(
|
|||||||
{ 1, 0, 0, 0, 0, 0, 0, 0, 0} /* ding */
|
{ 1, 0, 0, 0, 0, 0, 0, 0, 0} /* ding */
|
||||||
};
|
};
|
||||||
|
|
||||||
if (allowed[state_][state])
|
if (allowed[state_][state] == false)
|
||||||
{
|
|
||||||
wsrep::log_debug() << "server " << name_ << " state change: "
|
|
||||||
<< to_c_string(state_) << " -> "
|
|
||||||
<< to_c_string(state);
|
|
||||||
state_hist_.push_back(state_);
|
|
||||||
server_service_.log_state_change(state_, state);
|
|
||||||
state_ = state;
|
|
||||||
cond_.notify_all();
|
|
||||||
while (state_waiters_[state_])
|
|
||||||
{
|
|
||||||
cond_.wait(lock);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << "server: " << name_ << " unallowed state transition: "
|
os << "server: " << name_ << " unallowed state transition: "
|
||||||
<< wsrep::to_string(state_) << " -> " << wsrep::to_string(state);
|
<< wsrep::to_string(state_) << " -> " << wsrep::to_string(state);
|
||||||
wsrep::log_error() << os.str() << "\n";
|
wsrep::log_warning() << os.str() << "\n";
|
||||||
::abort();
|
assert(0);
|
||||||
// throw wsrep::runtime_error(os.str());
|
}
|
||||||
|
|
||||||
|
wsrep::log_debug() << "server " << name_ << " state change: "
|
||||||
|
<< to_c_string(state_) << " -> "
|
||||||
|
<< to_c_string(state);
|
||||||
|
state_hist_.push_back(state_);
|
||||||
|
server_service_.log_state_change(state_, state);
|
||||||
|
state_ = state;
|
||||||
|
cond_.notify_all();
|
||||||
|
while (state_waiters_[state_])
|
||||||
|
{
|
||||||
|
cond_.wait(lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user