From mboxrd@z Thu Jan 1 00:00:00 1970 From: pcaulfield@sourceware.org Date: 16 Jan 2007 09:54:43 -0000 Subject: [Cluster-devel] cluster/cman/daemon commands.c Message-ID: <20070116095443.28463.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Changes by: pcaulfield at sourceware.org 2007-01-16 09:54:43 Modified files: cman/daemon : commands.c Log message: Don't return to 'cman_tool leave' until we are just about to quit. Otherwise there can be a delay between cman_tool thinking that we are down, and the node really being out of the cluster. see bz#222686 Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.58&r2=1.59 --- cluster/cman/daemon/commands.c 2007/01/09 13:31:23 1.58 +++ cluster/cman/daemon/commands.c 2007/01/16 09:54:43 1.59 @@ -869,13 +869,13 @@ } else { reply = -EBUSY; + + /* Tell originator that shutdown was cancelled */ + send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, reply); + shutdown_con = NULL; } P_MEMB("shutdown decision is: %d (yes=%d, no=%d) flags=%x\n", reply, shutdown_yes, shutdown_no, shutdown_flags); - - /* Tell originator what we decided */ - send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, reply); - shutdown_con = NULL; } } @@ -1827,8 +1827,12 @@ P_MEMB("got LEAVE from node %d, reason = %d\n", nodeid, leavemsg->reason); /* We got our own leave message back. now quit */ - if (node && node->node_id == us->node_id) + if (node && node->node_id == us->node_id) { + /* Tell whomever asked us to leave that we are now going down */ + if (shutdown_con) + send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, 0); exit(0); + } /* Someone else, make a note of the reason for leaving */ if (node)