[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/cman/daemon cmanccs.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield sourceware org	2007-01-02 15:17:36

Modified files:
	cman/daemon    : cmanccs.c 

Log message:
	Bring forward the last two changes from HEAD:
	- add cluster_id to cluster.conf
	- improve error message if cluster name is too long.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.21.2.1&r2=1.21.2.2

--- cluster/cman/daemon/cmanccs.c	2006/11/30 10:47:23	1.21.2.1
+++ cluster/cman/daemon/cmanccs.c	2007/01/02 15:17:36	1.21.2.2
@@ -36,6 +36,7 @@
 #define CONFIG_VERSION_PATH	"/cluster/@config_version"
 #define CLUSTER_NAME_PATH	"/cluster/@name"
 
+#define CLUSTER_ID_PATH 	"/cluster/cman/@cluster_id"
 #define EXP_VOTES_PATH		"/cluster/cman/@expected_votes"
 #define TWO_NODE_PATH		"/cluster/cman/@two_node"
 #define MCAST_ADDR_PATH		"/cluster/cman/multicast/@addr"
@@ -217,6 +218,10 @@
 	 */
 	error = cman_join_cluster(cluster_name, cluster_id,
 				  two_node, expected_votes);
+	if (error == -EINVAL) {
+		write_cman_pipe("Cannot start, cluster name is too long or other CCS error");
+		return error;
+	}
 	if (error) {
 		write_cman_pipe("Cannot start, ais may already be running");
 		return error;
@@ -402,7 +407,15 @@
 		strcpy(cluster_name, str);
 	}
 	free(str);
-	cluster_id = generate_cluster_id(cluster_name);
+
+	error = ccs_get(cd, CLUSTER_ID_PATH, &str);
+	if (!error) {
+		cluster_id = atoi(str);
+		free(str);
+	}
+	else {
+		cluster_id = generate_cluster_id(cluster_name);
+	}
 
 	/* our nodename */
 	memset(nodename, 0, sizeof(nodename));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]