1
0
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:
Teemu Ollakka
2019-01-21 13:41:32 +02:00
parent 76875c3be1
commit 144d8c13c1

View File

@ -1093,8 +1093,15 @@ void wsrep::server_state::state(
{ 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: "
<< to_c_string(state_) << " -> "
<< to_c_string(state);
@ -1107,16 +1114,6 @@ void wsrep::server_state::state(
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(
wsrep::unique_lock<wsrep::mutex>& lock,