OpenZFS 8414 - Implemented zpool scrub pause/resume

Authored by: Alek Pinchuk <apinchuk@datto.com>
Reviewed by: George Melikov <mail@gmelikov.ru>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Approved by: Dan McDonald <danmcd@joyent.com>
Ported-by: Alek Pinchuk <apinchuk@datto.com>

OpenZFS-issue: https://www.illumos.org/issues/8414
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/c29616076
Closes #6538
This commit is contained in:
Alek P 2017-08-24 10:27:20 -07:00 committed by Brian Behlendorf
parent 9b8407638d
commit e4b6b2db12
2 changed files with 5 additions and 4 deletions

View File

@ -1846,9 +1846,11 @@ Stop scrubbing.
.Bl -tag -width Ds .Bl -tag -width Ds
.It Fl p .It Fl p
Pause scrubbing. Pause scrubbing.
Scrub progress is periodically synced to disk so if the system Scrub pause state and progress are periodically synced to disk.
is restarted or pool is exported during a paused scrub, the scrub will resume If the system is restarted or pool is exported during a paused scrub,
from the place where it was last checkpointed to disk. even after import, scrub will remain paused until it is resumed.
Once resumed the scrub will pick up from the place where it was last
checkpointed to disk.
To resume a paused scrub issue To resume a paused scrub issue
.Nm zpool Cm scrub .Nm zpool Cm scrub
again. again.

View File

@ -449,7 +449,6 @@ dsl_scrub_pause_resume_sync(void *arg, dmu_tx_t *tx)
spa_t *spa = dp->dp_spa; spa_t *spa = dp->dp_spa;
dsl_scan_t *scn = dp->dp_scan; dsl_scan_t *scn = dp->dp_scan;
if (*cmd == POOL_SCRUB_PAUSE) { if (*cmd == POOL_SCRUB_PAUSE) {
/* can't pause a scrub when there is no in-progress scrub */ /* can't pause a scrub when there is no in-progress scrub */
spa->spa_scan_pass_scrub_pause = gethrestime_sec(); spa->spa_scan_pass_scrub_pause = gethrestime_sec();