Skip to content

Commit

Permalink
Fix garbd's -w/WORK_DIR parameter
Browse files Browse the repository at this point in the history
This gets gvwstate.dat (cluster state) in a writable directory correctly.

Closes: codership#672
  • Loading branch information
abelhouane authored and ottok committed Jan 26, 2025
1 parent 7df088a commit 016d58e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions debian/patches/fix-work-dir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Author: Adel Belhouane <bugs.a.b@free.fr>
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_ + ";";

1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
rename-daemon-user.patch
small_gcache_size_for_salsa.patch
fix-work-dir.patch

0 comments on commit 016d58e

Please sign in to comment.