draid: allow seq resilver reads from degraded vdevs

When sequentially resilvering allow a dRAID child to be read
as long as the DTLs indicate it should have a good copy of the
data and the leaf isn't being rebuilt.  The previous check was
slightly too broad and would skip dRAID spare and replacing
vdevs if one of their children was being replaced.  As long
as there exists enough additional redundancy this is fine, but
when there isn't this vdev must be read in order to correctly
reconstruct the missing data.

A new test case has been added which exhausts the available
redundancy, faults another device causing it to be degraded,
and then performs a sequential resilver for the degraded device.
In such a situation enough redundancy exists to perform the
replacement and a scrub should detect no checksum errors.

Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
Reviewed-by: Akash B <akash-b@hpe.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #18405
This commit is contained in:
Brian Behlendorf
2026-04-07 10:48:27 -07:00
committed by Tony Hutter
parent 63b8da8ff7
commit e9a8c6e080
6 changed files with 162 additions and 35 deletions
+8 -3
View File
@@ -674,9 +674,14 @@ vdev_mirror_io_start(zio_t *zio)
/*
* When sequentially resilvering only issue write repair
* IOs to the vdev which is being rebuilt since performance
* is limited by the slowest child. This is an issue for
* faster replacement devices such as distributed spares.
* IOs to the vdev which is being rebuilt for two reasons:
* 1. The repair IO data calculated from parity has no checksum
* to validate and could be incorrect. Existing data must
* never be overwritten with unconfirmed data to ensure we
* never lock in unrecoverable damage to the pool.
* 2. Performance is limited by the slowest child device. We
* don't want a slower device to limit the rebuild rate for
* faster replacement devices such as distributed spares.
*/
if ((zio->io_priority == ZIO_PRIORITY_REBUILD) &&
(zio->io_flags & ZIO_FLAG_IO_REPAIR) &&