From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9392 invoked by alias); 28 Jul 2009 08:26:34 -0000 Received: (qmail 9386 invoked by alias); 28 Jul 2009 08:26:33 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: RHEL5 - cman: make cman_tool leave remove work even when no services are running. To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: 470a0f93bc2071a1ef26177b854cd7279730c247 X-Git-Newrev: 9c41df00092d785b3ad9fcb094bd0461581d3d95 From: Christine Caulfield Message-Id: <20090728082607.7B486120378@lists.fedorahosted.org> Date: Tue, 28 Jul 2009 08:26:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00111.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9c41df00092d785b3ad9fcb094bd0461581d3d95 Commit: 9c41df00092d785b3ad9fcb094bd0461581d3d95 Parent: 470a0f93bc2071a1ef26177b854cd7279730c247 Author: Christine Caulfield AuthorDate: Tue Jul 28 08:46:36 2009 +0100 Committer: Christine Caulfield CommitterDate: Tue Jul 28 08:51:46 2009 +0100 cman: make cman_tool leave remove work even when no services are running. cman_tool leave takes a shortcut internally if no services are listening for shutdown events. Unfortunately, a bug in this shortcut means that the leave flags gets lost, so quorum is not adjusted downwards. This patch fixes that shortcut. I should make it clear that 'leave remove' works fine if any cluster services are running. Signed-off-by: Christine Caulfield --- cman/daemon/commands.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c index 710449e..d400b25 100644 --- a/cman/daemon/commands.c +++ b/cman/daemon/commands.c @@ -947,6 +947,13 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf) /* If no-one is listening for events then we can just go down now */ if (shutdown_expected == 0) { send_leave(CLUSTER_LEAVEFLAG_DOWN); + int leaveflags = CLUSTER_LEAVEFLAG_DOWN; + + quit_threads = 1; + if (shutdown_flags & SHUTDOWN_REMOVE) + leaveflags |= CLUSTER_LEAVEFLAG_REMOVED; + + send_leave(leaveflags); return 0; } else {