Date: Tue, 14 Nov 2017 22:30:48 +0000 (UTC) From: Alan Somers <asomers@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r325833 - projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare Message-ID: <201711142230.vAEMUmCX087573@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: asomers Date: Tue Nov 14 22:30:48 2017 New Revision: 325833 URL: https://svnweb.freebsd.org/changeset/base/325833 Log: Fix intermittency in hotspare_import_001_pos tests/sys/cddl/zfs/tests/hotspare/hotspare_import_001_pos.ksh This test would occasionally fail because "zpool export" returns EBUSY. That's not unexpected since it immediately follows "zpool replace" and ZFS allows only one configuration change per transaction group. Usually a txg will close as soon as resilvering finishes, but sometimes "zpool export" sneaks in first. To fix the problem, allow up to one retry of "zpool export" Sponsored by: Spectra Logic Corp Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_import_001_pos.ksh Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_import_001_pos.ksh ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_import_001_pos.ksh Tue Nov 14 22:22:50 2017 (r325832) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_import_001_pos.ksh Tue Nov 14 22:30:48 2017 (r325833) @@ -77,7 +77,13 @@ function verify_export_import #pool #file #chksum typeset file=$2 typeset checksum1=$3 - log_must $ZPOOL export $pool + if ! $ZPOOL export $pool; then + # Rarely, this can fail with EBUSY if the pool's configuration + # has already changed within the same transaction group. In + # that case, it is appropriate to retry. + $SYNC + log_must $ZPOOL export $POOL + fi log_must $ZPOOL import -d $HOTSPARE_TMPDIR $pool [[ ! -e $file ]] && \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711142230.vAEMUmCX087573>