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

Re: [Cluster-devel] [PATCH] Make fenced's retry time configurable;



Updated patch per Dave's comments:
 * change retry_time to override_time (since that's what it really is)
 * update manual pages

-- Lon

Index: fenced/fd.h
===================================================================
RCS file: /cvs/cluster/cluster/fence/fenced/fd.h,v
retrieving revision 1.27
diff -u -r1.27 fd.h
--- fenced/fd.h	26 Oct 2007 20:36:49 -0000	1.27
+++ fenced/fd.h	30 Jan 2008 19:11:01 -0000
@@ -132,12 +132,15 @@
 {
 	int post_join_delay;
 	int post_fail_delay;
+	int override_time;
+	int pad;
 	char *override_path;
 	int8_t clean_start;
 	int8_t post_join_delay_opt;
 	int8_t post_fail_delay_opt;
 	int8_t clean_start_opt;
 	int8_t override_path_opt;
+	int8_t override_time_opt;
 };
 
 #define FDFL_RUN        (0)
Index: fenced/main.c
===================================================================
RCS file: /cvs/cluster/cluster/fence/fenced/main.c,v
retrieving revision 1.46
diff -u -r1.46 main.c
--- fenced/main.c	7 Jan 2008 05:52:28 -0000	1.46
+++ fenced/main.c	30 Jan 2008 19:11:01 -0000
@@ -15,7 +15,7 @@
 #include "ccs.h"
 #include "copyright.cf"
 
-#define OPTION_STRING			("cj:f:Dn:O:hVS")
+#define OPTION_STRING			("cj:f:Dn:O:T:hVS")
 #define LOCKFILE_NAME			"/var/run/fenced.pid"
 
 struct client {
@@ -162,6 +162,20 @@
 			free(str);
 	}
 
+	if (comline.override_time_opt == FALSE) {
+		str = NULL;
+		memset(path, 0, 256);
+		sprintf(path, "/cluster/fence_daemon/@override_time");
+
+		error = ccs_get(cd, path, &str);
+		if (!error && str)
+			comline.override_time = atoi(str);
+		if (str)
+			free(str);
+		if (comline.override_time < 3)
+			comline.override_time = 3;
+	}
+
 	log_debug("delay post_join %ds post_fail %ds",
 		  comline.post_join_delay, comline.post_fail_delay);
 
@@ -576,6 +590,8 @@
 	comline->post_join_delay_opt = FALSE;
 	comline->post_fail_delay_opt = FALSE;
 	comline->clean_start_opt = FALSE;
+	comline->override_time_opt = FALSE;
+	comline->override_time = 5;	/* default */
 
 	while (cont) {
 		optchar = getopt(argc, argv, OPTION_STRING);
@@ -602,6 +618,13 @@
 			comline->override_path_opt = TRUE;
 			break;
 
+		case 'R':
+			comline->override_time = atoi(optarg);
+			if (comline->override_time < 3)
+				comline->override_time = 3;
+			comline->override_time_opt = TRUE;
+			break;
+
 		case 'D':
 			daemon_debug_opt = TRUE;
 			break;
Index: fenced/recover.c
===================================================================
RCS file: /cvs/cluster/cluster/fence/fenced/recover.c,v
retrieving revision 1.30
diff -u -r1.30 recover.c
--- fenced/recover.c	26 Oct 2007 20:36:49 -0000	1.30
+++ fenced/recover.c	30 Jan 2008 19:11:01 -0000
@@ -402,7 +402,8 @@
 
 		/* Check for manual intervention */
 		override = open_override(comline.override_path);
-		if (check_override(override, node->name, 5) > 0) {
+		if (check_override(override, node->name,
+				   comline.override_time) > 0) {
 			syslog(LOG_WARNING, "fence \"%s\" overridden by "
 			       "administrator intervention", node->name);
 
Index: man/fenced.8
===================================================================
RCS file: /cvs/cluster/cluster/fence/man/fenced.8,v
retrieving revision 1.7
diff -u -r1.7 fenced.8
--- man/fenced.8	17 Aug 2007 18:26:16 -0000	1.7
+++ man/fenced.8	30 Jan 2008 19:11:01 -0000
@@ -143,6 +143,12 @@
 
   <fence_daemon override_path="/var/run/cluster/fenced_override"/>
 
+Override-time is the amount of time to wait for administrator
intervention
+after fencing has failed.  The default is 5 seconds.
+
+  <fence_daemon override_time="10"/>
+
+
 .SS Per-node fencing settings
 
 The per-node fencing configuration can become complex and is largely
@@ -273,7 +279,11 @@
 All nodes are in a clean state to start.
 .TP
 \fB-O\fP
-Path of the override fifo.
+Path of the override FIFO.
+.TP
+\fB-T\fP
+Amount of time to wait for administrator intervention after 
+fencing has failed, in seconds.
 .TP
 \fB-D\fP
 Enable debugging code and don't fork into the background.



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