This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE3 - cman: Don't sent a RECONFIGURE notification untilwe have a valid config


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=fdce9e94809745d687d7bfdf08c93294fb38273e
Commit:        fdce9e94809745d687d7bfdf08c93294fb38273e
Parent:        bbf66e399be7cf1f5f8e3b6b43f34ff8fdb33c7a
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Jan 14 14:30:21 2009 +0000
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Jan 14 14:30:21 2009 +0000

cman: Don't sent a RECONFIGURE notification until we have a valid config

Before this patch, cman would send a RECONFIGURE notification as soon
as it got a message that a new config file should be read. If that
failed then applications would get a new RECONFIGURE message every second
until it succeeded.

Now they just get one, at the end of the process.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/daemon/commands.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index a43909e..c1394d8 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1646,14 +1646,15 @@ static int valid_transition_msg(int nodeid, struct cl_transmsg *msg)
 	/* New config version - try to read new file */
 	if (msg->config_version > config_version) {
 
-		reread_config(msg->config_version);
+		if (!reread_config(msg->config_version)) {
 
-		if (config_version > msg->config_version) {
-			/* Tell everyone else to update */
-			send_reconfigure(us->node_id, RECONFIG_PARAM_CONFIG_VERSION, config_version);
+			if (config_version > msg->config_version) {
+				/* Tell everyone else to update */
+				send_reconfigure(us->node_id, RECONFIG_PARAM_CONFIG_VERSION, config_version);
+			}
+			recalculate_quorum(0, 0);
+			notify_listeners(NULL, EVENT_REASON_CONFIG_UPDATE, config_version);
 		}
-		recalculate_quorum(0, 0);
-		notify_listeners(NULL, EVENT_REASON_CONFIG_UPDATE, config_version);
 	}
 
 
@@ -1800,9 +1801,9 @@ static void do_reconfigure_msg(void *data)
 
 	case RECONFIG_PARAM_CONFIG_VERSION:
 		if (config_version != msg->value) {
-			reread_config(msg->value);
+			if (!reread_config(msg->value))
+				notify_listeners(NULL, EVENT_REASON_CONFIG_UPDATE, config_version);
 		}
-		notify_listeners(NULL, EVENT_REASON_CONFIG_UPDATE, config_version);
 		break;
 	}
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]