HomeFreeBSD

Another round of ZFS test reliability/performance improvements.

Description

Another round of ZFS test reliability/performance improvements.

tests/sys/cddl/zfs/include/libtest.kshlib:

  • Add create_vdevs, which creates sparse files for use as vdevs.
	  Set the default size to 10GB to encourage ZFS to allocate
	  blocks in large chunks for performance.
  • Simplify fill_fs, which was overly complicated.
  • Add get_tvd_prop, which uses zdb to determine the value of the
	  requested top-level vdev's property.
  • Add {raidz_,}dva_to_block_addr, which takes a DVA and converts
	  it to a block offset the DVA maps to.
  • Add vdevs_for_tvd, which returns the type, total number of
	  children and the usable children names, for the given
	  top-level vdev.
  • Add dva_to_vdev_off, which figures out what vdev and block
	  offset the requested DVA maps to.
  • Add file_dva, which uses the new zdb -o function to determine
	  the DVA for the requested file's block given the requested
	  offset and level in its block hierarchy.
  • Add corrupt_file, which uses all of the above together to
	  figure out exactly where to scribble random data onto a vdev.
  • Add busy_path and reap_children, which provide a generic
	  interface for making a path busy in the background and for
	  reaping the child processes that are generated from such.

tests/sys/cddl/zfs/tests/utils_test/utils_test.kshlib:
tests/sys/cddl/zfs/include/libtest.kshlib:

  • Move populate_dir from utils_test to libtest and generalize it to
	  allow the caller to specify the various arguments and whether to
	  snapshot after each round.

tests/sys/cddl/zfs/include/libtest.kshlib:
tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib:
tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_001_pos.ksh:

  • Add {vdev,pool}_has_errors, which is originally from the
	  redundancy suite & zpool_clear_001_pos.  This returns whether
	  the pool has the given number, or any errors.  The underlying
	  implementation counts the number of errors reported in 'zpool
	  status'.
  • Move is_healthy from redundancy to libtest, renamed
	  is_pool_healthy.

tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib:

  • replace_missing_devs(): Don't recreate the vdev if it already
	  exists.  In the case where damage_devs() is used (as opposed
	  to remove_devs()), the vdev file already exists and its state
	  reconciled (but not healthy until replaced later in this
	  function).

tests/sys/cddl/zfs/tests/slog/...:

  • Refactor device state table generation to a separate function.
	  Simplify the awk logic.
  • Refactor repeated loop patterns.

tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_004_pos.ksh:
tests/sys/cddl/zfs/tests/redundancy/...:

  • Reduce the runtime of these tests by >90% by using sparse
	  vdevs.
  • In the case of intentionally corrupting tests, this is also
	  accomplished by making use of the new mechanism that targets
	  the exact block required to generate corruption rather than
	  scribbling on entire vdevs.

tests/sys/cddl/zfs/tests/cli_root/zpool_import/...:

  • Fix several tests that were inadvertently testing with one
	  fewer vdev than they were supposed to ("$VDIV3" instead of
	  "$VDEV3").
  • Rewrite several tests to simply regenerate pools from scratch
	  instead of using a complicated mechanism of "saving" vdevs via
	  tar archives, which doesn't work well with large sparse vdevs.
  • More refactoring.

tests/sys/cddl/zfs/tests/compression/compress_001_pos.ksh:

  • Replace a silly "sleep 60" with a sync call to force the just
	  written file data to be pushed to disk.

tests/sys/cddl/zfs/tests/inheritance/inheritance_test.sh:

  • Increase timeout from 15 minutes to 30. This test (among
	  others) seems to expose ZFS sync task latency issues that need
	  to be fixed.

tests/sys/cddl/zfs/tests/hotspare/hotspare_detach_001_pos.ksh:
tests/sys/cddl/zfs/tests/hotspare/hotspare_scrub_001_pos.ksh:

  • Replace a silly "write a file 3/4ths the size of the pool"
	  routine with a fixed "write a 100MB file"; these tests aren't
	  dependent on the file size, they're just trying to generate
	  some pool I/O.

tests/sys/cddl/zfs/tests/clean_mirror/clean_mirror_common.kshlib:

  • Don't bother creating a files array since file names are
	  predictable.

tests/sys/cddl/zfs/tests/...:

  • Remove unnecessary cleanup steps; many tests cleaned up things
	  in a pool only to destroy it in the next step.  Many tests
	  also "restored" temp files created for the test instead of
	  just destroying.
  • Replace most uses of mkfile or dd to create file vdevs, with
	  calls to create_vdevs() using VDEV_SIZE where necessary.  Some
	  tests still create vdev files the old way because they can't
	  be changed quite so easily.  Most tests don't care about the
	  vdev size; for those tests it improves ZFS performance to run
	  on large sparse vdevs.
  • Refactor many excessively indented code sections.
  • Replace scores of duplicated code with various newly
	  introduced library function calls.

Submitted by: Will
Sponsored by: Spectra Logic Corp

Details

Provenance
asomersAuthored on
Parents
rS292360: sh: Fix use-after-free when attempting to modify a read-only variable.
Branches
Unknown
Tags
Unknown