From fdae687f1dc819e022e195bc68a4b7ebfac40137 Mon Sep 17 00:00:00 2001 From: Pekka Lampio Date: Tue, 21 Oct 2025 12:01:53 +0300 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 ce72bb4..ff366cc 100644 --- a/include/wsrep/server_state.hpp +++ b/include/wsrep/server_state.hpp @@ -625,6 +625,10 @@ namespace wsrep wsrep::mutex& mutex() { return mutex_; } + void disable_node_reset() { + disable_node_reset_ = true; + } + protected: /** Server state constructor * @@ -682,6 +686,7 @@ namespace wsrep , previous_primary_view_() , current_view_() , rollback_event_queue_() + , disable_node_reset_() { } private: @@ -764,6 +769,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 420929f..24f749e 100644 --- a/src/server_state.cpp +++ b/src/server_state.cpp @@ -813,7 +813,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; }