[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/fence/fenced fd.h member_cman.c recover.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield sourceware org	2006-10-09 10:52:50

Modified files:
	fence/fenced   : fd.h member_cman.c recover.c 

Log message:
	Don't fence a node if it has already been fenced.
	bz#204633

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/fd.h.diff?cvsroot=cluster&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/member_cman.c.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/recover.c.diff?cvsroot=cluster&r1=1.24&r2=1.25

--- cluster/fence/fenced/fd.h	2006/07/25 20:05:52	1.23
+++ cluster/fence/fenced/fd.h	2006/10/09 10:52:50	1.24
@@ -187,6 +187,7 @@
 void exit_member(void);
 int update_cluster_members(void);
 int is_member(char *name);
+int is_fenced(char *name);
 fd_node_t *get_new_node(fd_t *fd, int nodeid, char *in_name);
 
 #endif				/*  __FD_DOT_H__  */
--- cluster/fence/fenced/member_cman.c	2006/07/28 18:41:00	1.14
+++ cluster/fence/fenced/member_cman.c	2006/10/09 10:52:50	1.15
@@ -209,6 +209,29 @@
 	return 0;
 }
 
+int is_fenced(char *name)
+{
+	cman_node_t *cn;
+	char agent[255];
+	uint64_t fence_time;
+	int fenced = 0;
+
+	/* If the node is a cluster member then we won't even get called */
+	cn = find_cluster_node_name(name);
+	if (cn && cn->cn_member) {
+		return 1;
+	}
+
+	/* If this call fails (though it shouldn't) then regard the node as unfenced */
+	if (cman_get_fenceinfo(ch, cn->cn_nodeid, &fence_time, &fenced, agent)) {
+		log_debug("cman_get_fenceinfo failed: %s", strerror(errno));
+		fenced = 0;
+	}
+
+	log_debug("node \"%s\" has%s been fenced", name, fenced?"":" not");
+	return fenced;
+}
+
 fd_node_t *get_new_node(fd_t *fd, int nodeid, char *in_name)
 {
 	cman_node_t cn;
--- cluster/fence/fenced/recover.c	2006/07/10 17:02:43	1.24
+++ cluster/fence/fenced/recover.c	2006/10/09 10:52:50	1.25
@@ -300,7 +300,7 @@
 	while (!list_empty(&fd->victims)) {
 		node = list_entry(fd->victims.next, fd_node_t, list);
 
-		if (is_member(node->name)) {
+		if (is_member(node->name) || is_fenced(node->name)) {
 			log_debug("averting fence of node %s", node->name);
 			list_del(&node->list);
 			free(node);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]