Allows the timeout for failover during shutdown to be modified.
Defaults to 10s.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15858
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
SQ
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
FAILOVER_CONF_SECTION,
FAILOVER_CONF_DISABLED,
&ctdb_config.failover_disabled);
+ conf_assign_integer_pointer(conf,
+ FAILOVER_CONF_SECTION,
+ FAILOVER_CONF_SHUTDOWN_FAILOVER_TIMEOUT,
+ &ctdb_config.shutdown_failover_timeout);
/*
* Legacy
/* Failover */
bool failover_disabled;
+ int shutdown_failover_timeout;
/* Legacy */
bool realtime_scheduling;
FAILOVER_CONF_DISABLED,
false,
check_static_boolean_change);
+
+ conf_define_integer(conf,
+ FAILOVER_CONF_SECTION,
+ FAILOVER_CONF_SHUTDOWN_FAILOVER_TIMEOUT,
+ 10,
+ NULL);
}
#define FAILOVER_CONF_SECTION "failover"
#define FAILOVER_CONF_DISABLED "disabled"
+#define FAILOVER_CONF_SHUTDOWN_FAILOVER_TIMEOUT "shutdown failover timeout"
+
void failover_conf_init(struct conf_context *conf);
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>shutdown failover timeout = <parameter>TIMEOUT</parameter></term>
+ <listitem>
+ <para>
+ CTDB will wait for TIMEOUT seconds for failover to
+ complete during shutdown. This allows NFS servers on
+ other nodes to go into grace during graceful shutdown of a
+ node.
+ </para>
+ <para>
+ Set this to 0 to disable explicit failover on shutdown.
+ </para>
+ <para>
+ Default: <literal>10</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</refsect1>
#include "common/sock_io.h"
#include "common/srvid.h"
+#include "conf/ctdb_config.h"
#include "conf/node.h"
struct ctdb_client_pid_list {
* timeout.
*/
-#define CTDB_SHUTDOWN_FAILOVER_TIMEOUT 10
-
struct shutdown_takeover_state {
bool takeover_done;
bool timed_out;
};
int ret = 0;
- if (CTDB_SHUTDOWN_FAILOVER_TIMEOUT <= 0) {
+ if (ctdb_config.shutdown_failover_timeout <= 0) {
return;
}
state.te = tevent_add_timer(
ctdb->ev,
ctdb->srv,
- timeval_current_ofs(CTDB_SHUTDOWN_FAILOVER_TIMEOUT, 0),
+ timeval_current_ofs(ctdb_config.shutdown_failover_timeout, 0),
shutdown_timeout_handler,
&state);
if (state.te == NULL) {
# debug script =
[failover]
# disabled = false
+ # shutdown failover timeout = 10
[legacy]
# realtime scheduling = true
# lmaster capability = true