Hi Dejan,

I found some bugs.

1) When fence-timeout is not set and priority is set,
   priority's value is used as both fence_timeout and priority.
   The patch for this bug is fence-timeout.patch

2) Stonithd can execute only 2 or less plugins.
   With 3 or more plugins, priority is ignored.
   The patch for this is stonith_rsc_priorities.patch

I hope they are helpful to you.

Best Regards,
Satomi TANIGUCHI
diff -urN pacemaker-dev.orig/fencing/stonithd/stonithd.c pacemaker-dev/fencing/stonithd/stonithd.c
--- pacemaker-dev.orig/fencing/stonithd/stonithd.c	2008-09-26 16:07:38.000000000 +0900
+++ pacemaker-dev/fencing/stonithd/stonithd.c	2008-09-26 16:08:54.000000000 +0900
@@ -2846,6 +2846,7 @@
 		stonithd_log(LOG_DEBUG, "found fence priority: %s",value);
 		srsc->priority = atoi(value);
 	}
+	value = NULL;
 	my_hash_table_find(srsc->params, get_config_param,
 			(gpointer *)&param, (gpointer *)&value, "fence-timeout");
 	if (value) {
diff -urN pacemaker-dev.orig/fencing/stonithd/stonithd.c pacemaker-dev/fencing/stonithd/stonithd.c
--- pacemaker-dev.orig/fencing/stonithd/stonithd.c	2008-09-26 16:07:38.000000000 +0900
+++ pacemaker-dev/fencing/stonithd/stonithd.c	2008-09-26 16:10:54.000000000 +0900
@@ -167,6 +167,7 @@
 	Stonith *	stonith_obj;
 	char **		node_list;
 	int		priority;
+	gboolean	tried;
 	int		fence_timeout;
 } stonith_rsc_t;
 
@@ -2736,6 +2737,13 @@
 				,__FUNCTION__, __LINE__, begin_rsc_id);
 		}
 	}
+	else {
+		for (tmplist = g_list_first(local_started_stonith_rsc);
+			tmplist != NULL; tmplist = g_list_next(tmplist)) {
+			tmp_srsc = (stonith_rsc_t *)tmplist->data;
+			tmp_srsc->tried = FALSE;
+		}
+	}
 
 	/* Find the next stonith resource which has the same
 	 * priority number like the previous one (preferred) or
@@ -2752,8 +2760,11 @@
 			continue; /* skip the one we already tried */
 		if (!can_st_manage_node(tmp_srsc,node_name))
 			continue; /* this one is of no use for this node */
-		if (tmp_srsc->priority >= start_priority ||
-			(next_srsc && next_srsc->priority > tmp_srsc->priority))
+		if (tmp_srsc->tried == TRUE)
+			continue;
+		if ((tmp_srsc->priority >= start_priority) &&
+			((next_srsc == NULL) ||
+			 (next_srsc && next_srsc->priority > tmp_srsc->priority)))
 		{
 			next_srsc = tmp_srsc;
 			/* make sure to get the very next
@@ -2767,6 +2778,7 @@
 		"next stonith resource %s, priority %d"
 		,__FUNCTION__, __LINE__, next_srsc->rsc_id,
 		next_srsc->priority);
+		next_srsc->tried = TRUE;
 	}
 	return next_srsc;
 }
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to