File: fix-cluster-startup.patch

package info (click to toggle)
puppet-module-michaeltchapman-galera 0.7.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 380 kB
  • sloc: ruby: 453; sh: 74; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Fix cluster startup
 Without this patch, if all servers start at the same time, under some
 circonstances, the "galera_new_cluster" command isn't issue. This patch
 fixes the problem.
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2018-12-30

--- puppet-module-michaeltchapman-galera-0.7.1.orig/manifests/init.pp
+++ puppet-module-michaeltchapman-galera-0.7.1/manifests/init.pp
@@ -329,7 +329,14 @@ class galera(
 
     exec { 'bootstrap_galera_cluster':
       command  => $galera::params::bootstrap_command,
-      unless   => "nmap -Pn -p ${wsrep_group_comm_port} ${server_list} | grep -q '${wsrep_group_comm_port}/tcp open'",
+      unless   => "set -ex # bla
+for i in ${server_list} ; do
+        if nmap -Pn -p ${wsrep_group_comm_port} \$i | grep '${wsrep_group_comm_port}/tcp open' ; then
+                exit 0
+        fi
+done
+exit 1
+",
       require  => Class['mysql::server::installdb'],
       before   => Service['mysqld'],
       provider => shell,