Bug 225547 - zfsd(8): don't add a spare to a replacing vdev
Summary: zfsd(8): don't add a spare to a replacing vdev
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Alan Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-29 23:25 UTC by Alan Somers
Modified: 2018-03-06 04:18 UTC (History)
0 users

See Also:
asomers: mfc-stable11+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2018-01-29 23:25:41 UTC
If a zfs pool contains a replacing vdev (either created manually by "zpool replace" or by zfsd(8) via autoreplace by physical path) and then new spares get added to the pool, zfsd(8) will use one to replace the drive that is already being replaced.  That's a waste of resources that just slows down the rebuild.  zfsd should be changed not to do that.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-01-29 23:36:31 UTC
A commit references this bug:

Author: asomers
Date: Mon Jan 29 23:36:06 UTC 2018
New revision: 328570
URL: https://svnweb.freebsd.org/changeset/base/328570

Log:
  Add a regression test for PR 225547

  zfsd(8) shouldn't add a spare to a replacing vdev

  tests/sys/cddl/zfs/tests/zfsd/Makefile
  tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_008_neg.ksh
  tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh
  	Add a test case to check that zfsd shouldn't activate a spare for a
  	child of a replacing vdev.  Fixing zfsd itself is still TODO.

  PR:		225547
  Sponsored by:	Spectra Logic Corp

Changes:
  projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/Makefile
  projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_008_neg.ksh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-01-30 21:26:44 UTC
A commit references this bug:

Author: asomers
Date: Tue Jan 30 21:25:43 UTC 2018
New revision: 328605
URL: https://svnweb.freebsd.org/changeset/base/328605

Log:
  zfsd: Don't spare a vdev that's being replaced

  If a zfs pool contains a replacing vdev (either created manually by "zpool
  replace" or by zfsd(8) via autoreplace by physical path) and then new spares
  get added to the pool, zfsd shouldn't use one to replace the drive that is
  already being replaced.  That's a waste of resources that just slows down
  the rebuild.

  PR:		225547
  MFC after:	3 weeks
  Sponsored by:	Spectra Logic Corp

Changes:
  head/cddl/usr.sbin/zfsd/case_file.cc
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-01-30 21:26:45 UTC
A commit references this bug:

Author: asomers
Date: Tue Jan 30 21:26:31 UTC 2018
New revision: 328606
URL: https://svnweb.freebsd.org/changeset/base/328606

Log:
  Clear the expected failure for zfsd_hotspare_008_neg

  PR:		225547
  Sponsored by:	Spectra Logic Corp

Changes:
  projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-02-22 02:16:58 UTC
A commit references this bug:

Author: asomers
Date: Thu Feb 22 02:16:44 UTC 2018
New revision: 329792
URL: https://svnweb.freebsd.org/changeset/base/329792

Log:
  MFC r328605:

  zfsd: Don't spare a vdev that's being replaced

  If a zfs pool contains a replacing vdev (either created manually by "zpool
  replace" or by zfsd(8) via autoreplace by physical path) and then new spares
  get added to the pool, zfsd shouldn't use one to replace the drive that is
  already being replaced.  That's a waste of resources that just slows down
  the rebuild.

  PR:		225547
  Sponsored by:	Spectra Logic Corp

Changes:
_U  stable/11/
  stable/11/cddl/usr.sbin/zfsd/case_file.cc