svn commit: r325833 - projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare

Alan Somers asomers at FreeBSD.org
Tue Nov 14 22:30:49 UTC 2017


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 ]] && \


More information about the svn-src-projects mailing list