cluster: RHEL6 - cman: fix startup race condition when configs are different across nodes

Fabio M. Di Nitto fabbione at fedoraproject.org
Mon Oct 4 13:57:20 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=61ed8cd2262109c34b77a6ea478f25bfc106d618
Commit:        61ed8cd2262109c34b77a6ea478f25bfc106d618
Parent:        10d13e6f288bba93951cda1ee3230dc1e12f6b19
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Mon Oct 4 14:24:34 2010 +0200
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Mon Oct 4 15:57:06 2010 +0200

cman: fix startup race condition when configs are different across nodes

When a node with an old configuration rejoins the cluster, it creates a
complex set of race conditions that could lead to severe damage to the
cluster.

Fix the race condition by aborting immediatly if config versions are different.

Resolves: rhbz#639958

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 cman/daemon/cman.h  |    2 +-
 cman/init.d/cman.in |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cman/daemon/cman.h b/cman/daemon/cman.h
index af00659..1ec7eca 100644
--- a/cman/daemon/cman.h
+++ b/cman/daemon/cman.h
@@ -16,4 +16,4 @@ extern int our_nodeid(void);
 #define DEFAULT_SHUTDOWN_TIMEOUT 5000
 #define DEFAULT_CCSD_POLL        1000
 #define DEFAULT_DISALLOWED       0
-#define DEFAULT_STARTUP_CONFIG_TIMEOUT 10
+#define DEFAULT_STARTUP_CONFIG_TIMEOUT 0
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 50df96d..e8eba61 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -479,8 +479,10 @@ start_cman()
 		sleep 0.2
 	done
 
+	sleep 2
+
 	if ! cman_running; then
-		errmsg="$(cat $tmpfile)"
+		errmsg="$(cat $tmpfile) Check cluster logs for details"
 		ret=1
 	else
 		if [ "$CONFIG_VALIDATION" = "WARN" ] && \


More information about the cluster-commits mailing list