[Bug 289010] ZFS restarts resilver on completion of another resilver

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 24 Aug 2025 13:10:59 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289010

Allan Jude <allanjude@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |Works As Intended
             Status|New                         |Closed
                 CC|                            |allanjude@FreeBSD.org

--- Comment #1 from Allan Jude <allanjude@FreeBSD.org> ---
(In reply to David Gilbert from comment #0)

There is a feature in ZFS called 'deferred resilver'.

If a resilver is in progress, and something happens to start a second resilver,
in the past ZFS would have reset the resilver and started form the beginning.

With this newer feature, it instead queues the 2nd (and any subsequent)
resilver to start once the current one is finished, to avoid losing the
progress on the current resilver.

This is usually to your advantage, as restarting a resilver that was 70%
complete could make the overall process take longer, and also misses out on
restoring one level of parity much sooner.


However, in the case where you are running `zpool replace` twice, nearly back
to back, to cause two drives to resilver at once, you may wish to disable this
feature, so that starting the 2nd resilver resets the progress of the first one
(since it is likely less than 1% at this point), and allows the two resilvers
to complete in parallel.

You can do this by running:
`sysctl vfs.zfs.resilver_disable_defer=1`

before starting the resilvers. You can set it back to 0 once the resilvers have
started, to avoid:
A) a checksum error on another drive found during the resilver resetting your
progress
B) forgetting to unset it, and missing out on this advantage in the future.

-- 
You are receiving this mail because:
You are the assignee for the bug.