cluster/cman/daemon cmanccs.c cmanccs.h commands.c
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
cman/daemon/cmanccs.c +11 -1
@@ -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);
cman/daemon/cmanccs.h +1 -1
@@ -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 );
cman/daemon/commands.c +4 -4
@@ -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);