LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File cman_fix_startup_race_condition_when_configs_are_different_across_nodes.patch of Package cluster (Project home:sschapiro:openstack:upstream)

From 61ed8cd2262109c34b77a6ea478f25bfc106d618 Mon Sep 17 00:00:00 2001
From: Fabio M. Di Nitto <fdinitto@redhat.com>
Date: Mon, 4 Oct 2010 14:24:34 +0200
Subject: [PATCH] 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@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" ] && \
-- 
1.7.2.3