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: Make sure we have the same version on allnodes


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=75fb03241cbe1cf5995112debcf7617398ba1003
Commit:        75fb03241cbe1cf5995112debcf7617398ba1003
Parent:        5e2fdf75cc2d156ec6e0bb91645fccabfdabdaeb
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Mon Jan 19 15:36:38 2009 +0000
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Mon Jan 19 15:36:38 2009 +0000

cman: Make sure we have the same version on all nodes

Make sure that cman_tool version doesn't jst read the latest version on
the node and be satisfied with that.

Also, document this behaviour

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/daemon/commands.c |   14 +++++++++++++-
 cman/man/cman_tool.8   |   11 ++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index 27e18cd..d464cc1 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -91,7 +91,7 @@ static void recalculate_quorum(int allow_decrease, int by_current_nodes);
 static void send_kill(int nodeid, uint16_t reason);
 static char *killmsg_reason(int reason);
 static void ccsd_timer_fn(void *arg);
-
+static int reread_config(int new_version);
 
 static void set_port_bit(struct cluster_node *node, uint8_t port)
 {
@@ -477,6 +477,18 @@ static int do_cmd_set_version(char *cmdbuf, int *retlen)
 	if (config_version == version->config)
 		return 0;
 
+	/* If the passed-in version number is 0 then read the file now, then
+	 * tell the other nodes to look for that version number.
+	 * That means we also have to send the notification here, because it will
+	 * beskipped when we get our own RECONFIGURE message back as the version
+	 * number will match.
+	 */
+	if (!version->config) {
+		if (!reread_config(0))
+			notify_listeners(NULL, EVENT_REASON_CONFIG_UPDATE, config_version);
+		version->config = config_version;
+	}
+
 	/* We will re-read CCS when we get our own message back */
 	send_reconfigure(us->node_id, RECONFIG_PARAM_CONFIG_VERSION, version->config);
 	return 0;
diff --git a/cman/man/cman_tool.8 b/cman/man/cman_tool.8
index 4cd60a5..2825396 100644
--- a/cman/man/cman_tool.8
+++ b/cman/man/cman_tool.8
@@ -65,7 +65,16 @@ you need to get it running again in a hurry.
 .I version
 Used alone this will report the major, minor, patch and config versions
 used by CMAN (also displayed in 'cman_tool status'). It can also be used
-with -r to tell cluster members to update.
+with -r to tell cluster members to update. 
+.br
+The argument to -r is the version number that cman should look for. If 
+that version is not currently available then cman will poll for it. If
+a version of 0 is specified then cman will simply re-read the configuration
+and use the version number it finds there. 
+.br
+NOTE: this happens cluster-wide and the highest version number in the
+cluster will be the one everyone looks for. version -r0 is not a way
+to have different config versions across nodes in the cluster!
 
 .TP
 .I wait 


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