All of lore.kernel.org
 help / color / mirror / Atom feed
From: pcaulfield@sourceware.org <pcaulfield@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/cman/daemon cmanccs.c cmanccs.h commands.c
Date: 15 Aug 2006 10:27:14 -0000	[thread overview]
Message-ID: <20060815102714.6629.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2006-08-15 10:27:13

Modified files:
	cman/daemon    : cmanccs.c cmanccs.h commands.c 

Log message:
	At startup, check that ALL nodes in CCS have nodeids assigned.
	If not, then refuse to start.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.h.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.46&r2=1.47

--- cluster/cman/daemon/cmanccs.c	2006/08/11 12:34:18	1.19
+++ cluster/cman/daemon/cmanccs.c	2006/08/15 10:27:13	1.20
@@ -86,7 +86,7 @@
  * add them to our node list.
  * Called when we start up and on "cman_tool version".
  */
-int read_ccs_nodes(unsigned int *config_version)
+int read_ccs_nodes(unsigned int *config_version, int check_nodeids)
 {
     int ctree;
     char *nodename;
@@ -144,6 +144,16 @@
 	if (!ccs_get(ctree, key, &str))	{
 	    nodeid = atoi(str);
 	    free(str);
+
+	}
+
+	if (check_nodeids && nodeid == 0) {
+		char message[132];
+
+		sprintf(message, "No node ID for %s, run 'ccs_tool addnodeids' to fix", nodename);
+		log_msg(LOG_ERR, message);
+		write_cman_pipe(message);
+		return -1;
 	}
 
 	P_MEMB("Got node %s from ccs (id=%d, votes=%d)\n", nodename, nodeid, votes);
--- cluster/cman/daemon/cmanccs.h	2006/05/15 12:47:01	1.3
+++ cluster/cman/daemon/cmanccs.h	2006/08/15 10:27:13	1.4
@@ -10,5 +10,5 @@
 *******************************************************************************
 ******************************************************************************/
 
-int read_ccs_nodes(unsigned int *config_version);
+int read_ccs_nodes(unsigned int *config_version, int check_nodeid);
 int read_ccs_config(void);
--- cluster/cman/daemon/commands.c	2006/08/02 11:54:36	1.46
+++ cluster/cman/daemon/commands.c	2006/08/15 10:27:13	1.47
@@ -374,7 +374,7 @@
 	quit_threads = 0;
 	ais_running = 1;
 
-	if (read_ccs_nodes(&config_version)) {
+	if (read_ccs_nodes(&config_version, 1)) {
 		log_msg(LOG_ERR, "Can't initialise list of nodes from CCS\n");
 		return -EINVAL;
 	}
@@ -973,7 +973,7 @@
 	int ccs_err;
 
 	log_msg(LOG_DEBUG, "Polling ccsd for updated information\n");
-	ccs_err = read_ccs_nodes(&config_version);
+	ccs_err = read_ccs_nodes(&config_version, 0);
 	if (ccs_err || config_version < wanted_config_version) {
 		log_msg(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
 				wanted_config_version);
@@ -1401,7 +1401,7 @@
 	if (msg->config_version > config_version) {
 		int ccs_err;
 
-		ccs_err = read_ccs_nodes(&config_version);
+		ccs_err = read_ccs_nodes(&config_version, 0);
 		if (ccs_err || config_version < msg->config_version) {
 			config_error = 1;
 			log_msg(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
@@ -1555,7 +1555,7 @@
 		break;
 
 	case RECONFIG_PARAM_CONFIG_VERSION:
-		if (read_ccs_nodes(&config_version)) {
+		if (read_ccs_nodes(&config_version, 0)) {
 			log_msg(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
 				msg->value);
 



                 reply	other threads:[~2006-08-15 10:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060815102714.6629.qmail@sourceware.org \
    --to=pcaulfield@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.