cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Cluster Project branch, RHEL5, updated. cmirror_1_1_15-162-g9567fe1
Date: 23 Jul 2008 18:15:03 -0000	[thread overview]
Message-ID: <20080723181503.902.qmail@sourceware.org> (raw)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=9567fe17bf33eb0008831551b76c7f46c55ba40b

The branch, RHEL5 has been updated
       via  9567fe17bf33eb0008831551b76c7f46c55ba40b (commit)
      from  5ff7b6671b739796e5c3f4f2f8cc0005015936cc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9567fe17bf33eb0008831551b76c7f46c55ba40b
Author: David Teigland <teigland@redhat.com>
Date:   Wed Jul 23 12:57:49 2008 -0500

    fenced: update cman only after complete success
    
    bz 456403
    
    Problem discovered by Lon:  tell cman about a completed fencing
    operation only after all devices within a method have completed
    successfully.  Otherwise, if the first device succeeds, cman will
    be told the node is fenced, even if the second device fails.  When
    fenced subsequently retries the fencing, it asks cman if fencing is
    complete, and is wrongly told it is (the purpose of asking cman is
    to avoid double fencing when a node is fenced externally via
    fence_node).  So, a failed node can be considered successfully
    fenced when it hasn't been.
    
    Signed-off-by: David Teigland <teigland@redhat.com>

-----------------------------------------------------------------------

Summary of changes:
 fence/fenced/agent.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/fence/fenced/agent.c b/fence/fenced/agent.c
index 0577e8f..66ae77a 100644
--- a/fence/fenced/agent.c
+++ b/fence/fenced/agent.c
@@ -304,9 +304,12 @@ void update_cman(char *victim, char *method)
 
 int dispatch_fence_agent(char *victim, int force)
 {
+	char good_device[256];
 	char *method = NULL, *device = NULL;
 	int num_methods, num_devices, m, d, error = -1, cd;
 
+	strcpy(good_device, "UNKNOWN");
+
 	if (force)
 		cd = ccs_force_connect(NULL, 0);
 	else {
@@ -331,16 +334,13 @@ int dispatch_fence_agent(char *victim, int force)
 		if (error == -EBADR) {
 			syslog(LOG_INFO, "ccs connection timed out, "
 				"retrying\n");
-
 			while ((cd = ccs_connect()) < 0)
 				sleep(1);
-			
 			error = get_method(cd, victim, m, &method);
-
+		}
+		
 		if (error)
 			continue;
-		} else if (error)
-			continue;
 
 		/* if num_devices is zero we should return an error */
 		error = -1;
@@ -356,7 +356,7 @@ int dispatch_fence_agent(char *victim, int force)
 			if (error)
 				break;
 
-			update_cman(victim, device);
+			strncpy(good_device, device, sizeof(good_device));
 			free(device);
 			device = NULL;
 		}
@@ -365,8 +365,10 @@ int dispatch_fence_agent(char *victim, int force)
 			free(device);
 		free(method);
 
-		if (!error)
+		if (!error) {
+			update_cman(victim, good_device);
 			break;
+		}
 	}
 
 	ccs_disconnect(cd);


hooks/post-receive
--
Cluster Project



                 reply	other threads:[~2008-07-23 18:15 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=20080723181503.902.qmail@sourceware.org \
    --to=teigland@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).