mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-07-24 16:47:42 +03:00

When Multihost is enabled, and a pool is imported, uberblock writes include ub_mmp_delay to allow an importing node to calculate the duration of an activity test. This value, is not enough information. If zfs_multihost_fail_intervals > 0 on the node with the pool imported, the safe minimum duration of the activity test is well defined, but does not depend on ub_mmp_delay: zfs_multihost_fail_intervals * zfs_multihost_interval and if zfs_multihost_fail_intervals == 0 on that node, there is no such well defined safe duration, but the importing host cannot tell whether mmp_delay is high due to I/O delays, or due to a very large zfs_multihost_interval setting on the host which last imported the pool. As a result, it may use a far longer period for the activity test than is necessary. This patch renames ub_mmp_sequence to ub_mmp_config and uses it to record the zfs_multihost_interval and zfs_multihost_fail_intervals values, as well as the mmp sequence. This allows a shorter activity test duration to be calculated by the importing host in most situations. These values are also added to the multihost_history kstat records. It calculates the activity test duration differently depending on whether the new fields are present or not; for importing pools with only ub_mmp_delay, it uses (zfs_multihost_interval + ub_mmp_delay) * zfs_multihost_import_intervals Which results in an activity test duration less sensitive to the leaf count. In addition, it makes a few other improvements: * It updates the "sequence" part of ub_mmp_config when MMP writes in between syncs occur. This allows an importing host to detect MMP on the remote host sooner, when the pool is idle, as it is not limited to the granularity of ub_timestamp (1 second). * It issues writes immediately when zfs_multihost_interval is changed so remote hosts see the updated value as soon as possible. * It fixes a bug where setting zfs_multihost_fail_intervals = 1 results in immediate pool suspension. * Update tests to verify activity check duration is based on recorded tunable values, not tunable values on importing host. * Update tests to verify the expected number of uberblocks have valid MMP fields - fail_intervals, mmp_interval, mmp_seq (sequence number), that sequence number is incrementing, and that uberblock values match tunable settings. Reviewed-by: Andreas Dilger <andreas.dilger@whamcloud.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Olaf Faaland <faaland1@llnl.gov> Closes #7842
47 lines
1.2 KiB
INI
47 lines
1.2 KiB
INI
#
|
|
# CDDL HEADER START
|
|
#
|
|
# This file and its contents are supplied under the terms of the
|
|
# Common Development and Distribution License ("CDDL"), version 1.0.
|
|
# You may only use this file in accordance with the terms of version
|
|
# 1.0 of the CDDL.
|
|
#
|
|
# A full copy of the text of the CDDL should have accompanied this
|
|
# source. A copy of the CDDL is also available via the Internet at
|
|
# http://www.illumos.org/license/CDDL.
|
|
#
|
|
# CDDL HEADER END
|
|
#
|
|
|
|
#
|
|
# Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
|
|
#
|
|
|
|
export PREV_UBER="$TEST_BASE_DIR/mmp-uber-prev.txt"
|
|
export CURR_UBER="$TEST_BASE_DIR/mmp-uber-curr.txt"
|
|
export DISK=${DISKS%% *}
|
|
|
|
export HOSTID_FILE="/etc/hostid"
|
|
export HOSTID1=01234567
|
|
export HOSTID2=89abcdef
|
|
|
|
export TXG_TIMEOUT_LONG=5000
|
|
export TXG_TIMEOUT_DEFAULT=5
|
|
|
|
export MMP_POOL=mmppool
|
|
export MMP_DIR=$TEST_BASE_DIR/mmp
|
|
export MMP_CACHE=$MMP_DIR/zpool.cache
|
|
export MMP_ZTEST_LOG=$MMP_DIR/ztest.log
|
|
export MMP_HISTORY=100
|
|
export MMP_HISTORY_OFF=0
|
|
|
|
export MMP_INTERVAL_HOUR=$((60*60*1000))
|
|
export MMP_INTERVAL_DEFAULT=1000
|
|
export MMP_INTERVAL_MIN=100
|
|
|
|
export MMP_IMPORT_INTERVALS=20
|
|
export MMP_FAIL_INTERVALS_DEFAULT=10
|
|
export MMP_FAIL_INTERVALS_MIN=2
|
|
|
|
export MMP_TEST_DURATION_DEFAULT=$((MMP_IMPORT_INTERVALS*MMP_INTERVAL_DEFAULT/1000))
|