From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/fence/fenced agent.c fd.h recover.c
Date: 26 Oct 2007 18:05:43 -0000 [thread overview]
Message-ID: <20071026180543.31937.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2007-10-26 18:05:43
Modified files:
fence/fenced : agent.c fd.h recover.c
Log message:
Applying patch from Marco Ceci to fix 354421
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/agent.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.15.2.1&r2=1.15.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/fd.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.24.2.2&r2=1.24.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/recover.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.25.2.4&r2=1.25.2.5
--- cluster/fence/fenced/agent.c 2006/12/01 19:17:46 1.15.2.1
+++ cluster/fence/fenced/agent.c 2007/10/26 18:05:42 1.15.2.2
@@ -302,18 +302,45 @@
cman_finish(ch);
}
-int dispatch_fence_agent(int cd, char *victim)
+int dispatch_fence_agent(char *victim, int force)
{
char *method = NULL, *device = NULL;
- int num_methods, num_devices, m, d, error = -1;
+ int num_methods, num_devices, m, d, error = -1, cd;
+
+ if (force)
+ cd = ccs_force_connect(NULL, 0);
+ else {
+ while ((cd = ccs_connect()) < 0)
+ sleep(1);
+ }
+
+ if (cd < 0) {
+ syslog(LOG_ERR, "cannot connect to ccs %d\n", cd);
+ return -1;
+ }
num_methods = count_methods(cd, victim);
for (m = 0; m < num_methods; m++) {
error = get_method(cd, victim, m, &method);
+
+ /* if the connection timed out while we were trying
+ * to fence, try to open the connection again
+ */
+ 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;
@@ -342,6 +369,8 @@
break;
}
+ ccs_disconnect(cd);
+
return error;
}
--- cluster/fence/fenced/fd.h 2007/01/29 20:30:25 1.24.2.2
+++ cluster/fence/fenced/fd.h 2007/10/26 18:05:42 1.24.2.3
@@ -176,7 +176,7 @@
void do_recovery_done(fd_t *fd);
/* agent.c */
-int dispatch_fence_agent(int cd, char *victim);
+int dispatch_fence_agent(char *victim, int force);
/* group.c */
int setup_groupd(void);
--- cluster/fence/fenced/recover.c 2007/09/18 20:53:17 1.25.2.4
+++ cluster/fence/fenced/recover.c 2007/10/26 18:05:42 1.25.2.5
@@ -12,7 +12,6 @@
******************************************************************************/
#include "fd.h"
-#include "ccs.h"
#include <sys/time.h>
#include <sys/types.h>
#include <sys/select.h>
@@ -359,7 +358,7 @@
{
fd_node_t *node;
char *master_name;
- int master, error, cd;
+ int master, error;
int override = -1;
master = find_master_nodeid(fd, &master_name);
@@ -372,9 +371,6 @@
delay_fencing(fd, start_type);
- while ((cd = ccs_connect()) < 0)
- sleep(1);
-
while (!list_empty(&fd->victims)) {
node = list_entry(fd->victims.next, fd_node_t, list);
@@ -388,7 +384,7 @@
log_debug("fencing node %s", node->name);
syslog(LOG_INFO, "fencing node \"%s\"", node->name);
- error = dispatch_fence_agent(cd, node->name);
+ error = dispatch_fence_agent(node->name, 0);
syslog(LOG_INFO, "fence \"%s\" %s", node->name,
error ? "failed" : "success");
@@ -415,8 +411,6 @@
}
close_override(&override, comline.override_path);
}
-
- ccs_disconnect(cd);
}
static void add_victims(fd_t *fd, int start_type, int member_count,
next reply other threads:[~2007-10-26 18:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-26 18:05 rmccabe [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-10-26 20:36 [Cluster-devel] cluster/fence/fenced agent.c fd.h recover.c rmccabe
2006-12-01 19:57 rohara
2006-12-01 19:17 rohara
2006-07-10 17:02 rohara
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=20071026180543.31937.qmail@sourceware.org \
--to=rmccabe@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).