mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +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,8 +1093,15 @@ 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)
|
||||||
{
|
{
|
||||||
|
std::ostringstream os;
|
||||||
|
os << "server: " << name_ << " unallowed state transition: "
|
||||||
|
<< wsrep::to_string(state_) << " -> " << wsrep::to_string(state);
|
||||||
|
wsrep::log_warning() << os.str() << "\n";
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
|
||||||
wsrep::log_debug() << "server " << name_ << " state change: "
|
wsrep::log_debug() << "server " << name_ << " state change: "
|
||||||
<< to_c_string(state_) << " -> "
|
<< to_c_string(state_) << " -> "
|
||||||
<< to_c_string(state);
|
<< to_c_string(state);
|
||||||
@ -1107,16 +1114,6 @@ void wsrep::server_state::state(
|
|||||||
cond_.wait(lock);
|
cond_.wait(lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
std::ostringstream os;
|
|
||||||
os << "server: " << name_ << " unallowed state transition: "
|
|
||||||
<< wsrep::to_string(state_) << " -> " << wsrep::to_string(state);
|
|
||||||
wsrep::log_error() << os.str() << "\n";
|
|
||||||
::abort();
|
|
||||||
// throw wsrep::runtime_error(os.str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void wsrep::server_state::wait_until_state(
|
void wsrep::server_state::wait_until_state(
|
||||||
wsrep::unique_lock<wsrep::mutex>& lock,
|
wsrep::unique_lock<wsrep::mutex>& lock,
|
||||||
|
Reference in New Issue
Block a user