From 016d58ecfb2463b5aeed7e54633b75959071a45c Mon Sep 17 00:00:00 2001 From: Adel Belhouane Date: Sun, 26 Jan 2025 18:34:13 +0000 Subject: [PATCH] Fix garbd's -w/WORK_DIR parameter This gets gvwstate.dat (cluster state) in a writable directory correctly. Closes: https://github.com/codership/galera/issues/672 --- debian/patches/fix-work-dir.patch | 44 +++++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 45 insertions(+) create mode 100644 debian/patches/fix-work-dir.patch diff --git a/debian/patches/fix-work-dir.patch b/debian/patches/fix-work-dir.patch new file mode 100644 index 000000000..14c24bf94 --- /dev/null +++ b/debian/patches/fix-work-dir.patch @@ -0,0 +1,44 @@ +Author: Adel Belhouane +Description: Fix garbd's -w / WORK_DIR parameter +Forwarded: https://github.com/codership/galera/issues/672 +Last-Update: 2025-01-26 + + The -w parameter (typically enabled from /etc/default/garb with the + WORK_DIR= variable) allows to save the gvwstate.dat file with cluster + information elsewhere than non-writable / . + + It appears a mandatory semicolon to separate the internal parameters + configuration string was somehow lost in garb/garb_config.cpp during two + possibly conflicting commits in upstream's repository: + + Add command line option to specify desired working directory where + + https://github.com/codership/galera/commit/29d906e6239e0a4111214a8bf7f0779308f479f8 + + and: + + Fix renaming of fc_master_slave to fc_single_primary. In particular don't + + https://github.com/codership/galera/commit/b3c498328b699c733e5c881fcc66a6f721ac674d + + causing a syntax error when the resulting internal parameter base_dir gets + used: + + FATAL: Exception in creating receive loop: More than one value for key 'gcs.fc_single_primary' at ' gcs.fc_single_primary=yes base_dir=/tmp' in parameter list. + + Restore the mandatory missing semicolon to fix this issue. + +diff --git a/garb/garb_config.cpp b/garb/garb_config.cpp +index ec7650a5..6eb15f6c 100644 +--- a/garb/garb_config.cpp ++++ b/garb/garb_config.cpp +@@ -143,7 +143,7 @@ Config::Config (int argc, char* argv[]) + strip_quotes(cfg_); + + if (options_.length() > 0) options_ += "; "; +- options_ += "gcs.fc_limit=9999999; gcs.fc_factor=1.0; gcs.fc_single_primary=yes"; ++ options_ += "gcs.fc_limit=9999999; gcs.fc_factor=1.0; gcs.fc_single_primary=yes;"; + if (!workdir_.empty()) + { + options_ += " base_dir=" + workdir_ + ";"; + diff --git a/debian/patches/series b/debian/patches/series index a4a7b531f..9da559f60 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ rename-daemon-user.patch small_gcache_size_for_salsa.patch +fix-work-dir.patch