From 7010f0ab584ab9cdebb285272a0fb0ff0a5a791d Mon Sep 17 00:00:00 2001 From: Pekka Lampio Date: Wed, 26 Nov 2025 16:19:48 +0200 Subject: [PATCH] MDEV-31517 Wrong variable name in the configuration leads Galera to think SST/IST failed, at next restart will request a full SST This patch fixes an unwanted behavior of a Galera cluster node when Server startup fails because of an error in configuration file: after the failure full SST is requested at the next Server startup even though full SST is not needed (MDEV-31517). If Server startup fails because of a configuration error, this patch ensures that Galera state of the failing node remains unchanged. This avoids full SST at the next Server restart. This fix consists of three patches for the following components: 1) Server, 2) WSREP library, 3) Galera. --- include/wsrep/server_state.hpp | 6 ++++++ src/server_state.cpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/wsrep/server_state.hpp b/include/wsrep/server_state.hpp index 632d43b..104a231 100644 --- a/include/wsrep/server_state.hpp +++ b/include/wsrep/server_state.hpp @@ -594,6 +594,10 @@ namespace wsrep wsrep::mutex& mutex() { return mutex_; } + void disable_node_reset() { + disable_node_reset_ = true; + } + protected: /** Server state constructor * @@ -651,6 +655,7 @@ namespace wsrep , previous_primary_view_() , current_view_() , rollback_event_queue_() + , disable_node_reset_() { } private: @@ -733,6 +738,7 @@ namespace wsrep wsrep::view previous_primary_view_; wsrep::view current_view_; std::deque rollback_event_queue_; + bool disable_node_reset_; }; static inline const char* to_c_string( diff --git a/src/server_state.cpp b/src/server_state.cpp index 270c45e..5bef9c6 100644 --- a/src/server_state.cpp +++ b/src/server_state.cpp @@ -811,7 +811,8 @@ catch (const wsrep::runtime_error& e) wsrep::log_error() << "sst_received failed: " << e.what(); if (provider_) { - provider_->sst_received(wsrep::gtid::undefined(), -EINTR); + provider_->sst_received(wsrep::gtid::undefined(), + (disable_node_reset_ ? -ECANCELED : -EINTR)); } return 1; }