See documentation change for details.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15858
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
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_EXTRA_TIMEOUT,
+ &ctdb_config.shutdown_extra_timeout);
conf_assign_integer_pointer(conf,
FAILOVER_CONF_SECTION,
FAILOVER_CONF_SHUTDOWN_FAILOVER_TIMEOUT,
/* Failover */
bool failover_disabled;
+ int shutdown_extra_timeout;
int shutdown_failover_timeout;
/* Legacy */
false,
check_static_boolean_change);
+ conf_define_integer(conf,
+ FAILOVER_CONF_SECTION,
+ FAILOVER_CONF_SHUTDOWN_EXTRA_TIMEOUT,
+ 0,
+ NULL);
+
conf_define_integer(conf,
FAILOVER_CONF_SECTION,
FAILOVER_CONF_SHUTDOWN_FAILOVER_TIMEOUT,
#define FAILOVER_CONF_SECTION "failover"
#define FAILOVER_CONF_DISABLED "disabled"
+#define FAILOVER_CONF_SHUTDOWN_EXTRA_TIMEOUT "shutdown extra timeout"
#define FAILOVER_CONF_SHUTDOWN_FAILOVER_TIMEOUT "shutdown failover timeout"
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>shutdown extra timeout = <parameter>TIMEOUT</parameter></term>
+ <listitem>
+ <para>
+ CTDB will wait for TIMEOUT seconds after failover
+ completes during shutdown. This can provide extra time
+ for SMB durable handles to be reclaimed. If set to 0 then
+ no extra timeout occurs.
+ </para>
+ <para>
+ This timeout only occurs if both of the following
+ conditions are true:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ shutdown failover timeout (below) is not 0
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Failover during shutdown completes and does not time out
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Default: <literal>0</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term>shutdown failover timeout = <parameter>TIMEOUT</parameter></term>
<listitem>
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.
+ node. Failover during shutdown also helps with SMB
+ durable handle reclaim.
</para>
<para>
Set this to 0 to disable explicit failover on shutdown.
srvid_deregister(ctdb->srv, CTDB_SRVID_TAKEOVER_RUN, &state);
srvid_deregister(ctdb->srv, CTDB_SRVID_LEADER, &state);
TALLOC_FREE(state.te);
+
+ if (!state.takeover_done || ctdb_config.shutdown_extra_timeout <= 0) {
+ return;
+ }
+
+ state.timed_out = false;
+ state.te = tevent_add_timer(
+ ctdb->ev,
+ ctdb->srv,
+ timeval_current_ofs(ctdb_config.shutdown_extra_timeout, 0),
+ shutdown_timeout_handler,
+ &state);
+ if (state.te == NULL) {
+ DBG_WARNING("Failed to set extra timeout\n");
+ return;
+ }
+
+ DBG_NOTICE("Waiting %ds for shutdown extra timeout\n",
+ ctdb_config.shutdown_extra_timeout);
+ while (!state.timed_out) {
+ tevent_loop_once(ctdb->ev);
+ }
+ DBG_INFO("shutdown extra timeout complete\n");
}
void ctdb_shutdown_sequence(struct ctdb_context *ctdb, int exit_code)
# debug script =
[failover]
# disabled = false
+ # shutdown extra timeout = 0
# shutdown failover timeout = 10
[legacy]
# realtime scheduling = true