[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
Changes by:	pcaulfield sourceware org	2006-12-15 13:43:03

Modified files:
	cman/daemon    : cmanccs.c 

Log message:
	Add cluster_id override field to cluster.conf, so that people can manually
	assign cluster IDs where the hash values for similar names clash

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.22&r2=1.23

--- cluster/cman/daemon/cmanccs.c	2006/11/30 10:46:35	1.22
+++ cluster/cman/daemon/cmanccs.c	2006/12/15 13:43:03	1.23
@@ -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"
@@ -402,7 +403,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]