From 787aa86d1b16c9b030ebaf5a35d10719d31b77aa Mon Sep 17 00:00:00 2001 From: Alexey Yurchenko Date: Tue, 22 Apr 2025 22:18:46 +0200 Subject: [PATCH] It may happen so that disconnect() is called in s_joined state just an instance before the SYNCED event is delivered. Thus wsrep-lib is already in s_disconnecting state but still will transition to s_synced albeit with a warning. This is pointless and possibly harmful. If we are disconnecting ignore any remaining state events from the replication queue. Refs codership/wsrep-lib#251 --- src/server_state.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server_state.cpp b/src/server_state.cpp index 270c45e..c727dba 100644 --- a/src/server_state.cpp +++ b/src/server_state.cpp @@ -1364,6 +1364,10 @@ void wsrep::server_state::state( if (allowed[state_][state] == false) { + /* If we are disconnecting ignore any remaining state events from + * the replication queue */ + if (s_disconnecting == state_) return; + std::ostringstream os; os << "server: " << name_ << " unallowed state transition: " << wsrep::to_string(state_) << " -> " << wsrep::to_string(state);