diff options
author | John Poduska <[email protected]> | 2020-05-13 13:54:27 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-13 10:54:27 -0700 |
commit | 41035a049643ff7083a6cb6cd43b8eb70a7d18a1 (patch) | |
tree | 121cec91a2b10ca6e9fb7d376a7599d47f4aee8c /tests/runfiles/common.run | |
parent | b29e31d80d6cb78dbd889e9b529333944b4c3ba1 (diff) |
Resilver restarts unnecessarily when it encounters errors
When a resilver finishes, vdev_dtl_reassess is called to hopefully
excise DTL_MISSING (amongst other things). If there are errors during
the resilver, they are tracked in DTL_SCRUB, as spelled out in the
block comment in vdev.c. DTL_SCRUB is in-core only, so it can only
be used if the pool was online for the whole resilver. This state is
tracked with the spa_scrub_started flag, which only gets set when
the scan is initialized. Unfortunately, this flag gets cleared right
before vdev_dtl_reassess gets called, so if there are any errors
during the scan, DTL_MISSING will never get excised and the resilver
will just continually restart. This fix simply moves clearing that
flag until after the call to vdev_dtl_reasses.
In addition, if a pool is imported and already has scn_errors > 0,
this change will restart the resilver immediately instead of doing
the rest of the scan and then restarting it from the beginning. On
the other hand, if scn_errors == 0 at import, then no errors have
been encountered so far, so the spa_scrub_started flag can be safely
set.
A test has been added to verify that resilver does not restart when
relevant DTL's are available.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Paul Zuchowski <[email protected]>
Signed-off-by: John Poduska <[email protected]>
Closes #10291
Diffstat (limited to 'tests/runfiles/common.run')
-rw-r--r-- | tests/runfiles/common.run | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/runfiles/common.run b/tests/runfiles/common.run index 2fcde83b3..a9bede475 100644 --- a/tests/runfiles/common.run +++ b/tests/runfiles/common.run @@ -758,7 +758,7 @@ tests = ['reservation_001_pos', 'reservation_002_pos', 'reservation_003_pos', tags = ['functional', 'reservation'] [tests/functional/resilver] -tests = ['resilver_restart_001'] +tests = ['resilver_restart_001', 'resilver_restart_002'] tags = ['functional', 'resilver'] [tests/functional/rootpool] |