1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2026-10-23 09:48:57 +03:00

Change wait_until_state() early disconnected check

The check is done only when SST happens before server
initialization to be compatible with Galera.
This commit is contained in:
Teemu Ollakka
2023-09-21 11:59:26 +03:00
parent 13e9403eba
commit db7ddd0b11

View File

@@ -1393,6 +1393,14 @@ void wsrep::server_state::wait_until_state(
wsrep::unique_lock<wsrep::mutex>& lock,
enum wsrep::server_state::state state) const
{
if (!server_service_.sst_before_init() && state != s_disconnected
&& state_ == s_disconnected)
{
std::ostringstream os;
os << "Found server disconnected while waiting state " << state;
throw wsrep::runtime_error(os.str());
}
++state_waiters_[state];
while (state_ != state)
{
@@ -1401,8 +1409,9 @@ void wsrep::server_state::wait_until_state(
// or disconnected and the state has been changed to disconnecting,
// this usually means that some error was encountered
if (state != s_disconnecting && state != s_disconnected
&& state_ == s_disconnecting)
&& (state_ == s_disconnecting || state_ == s_disconnected))
{
--state_waiters_[state];
throw wsrep::runtime_error("State wait was interrupted");
}
}