Teach zpool scrub to scrub only blocks in error log

Added a flag '-e' in zpool scrub to scrub only blocks in error log. A
user can pause, resume and cancel the error scrub by passing additional
command line arguments -p -s just like a regular scrub. This involves
adding a new flag, creating new libzfs interfaces, a new ioctl, and the
actual iteration and read-issuing logic. Error scrubbing is executed in
multiple txg to make sure pool performance is not affected.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Co-authored-by: TulsiJain tulsi.jain@delphix.com
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #8995
Closes #12355
This commit is contained in:
George Amanakis
2021-12-17 21:35:28 +01:00
committed by Brian Behlendorf
parent e34e15ed6d
commit 482eeef804
29 changed files with 1602 additions and 71 deletions
+18
View File
@@ -1969,6 +1969,12 @@ function is_pool_scrubbing #pool <verbose>
check_pool_status "$1" "scan" "scrub in progress since " $2
}
function is_pool_error_scrubbing #pool <verbose>
{
check_pool_status "$1" "scrub" "error scrub in progress since " $2
return $?
}
function is_pool_scrubbed #pool <verbose>
{
check_pool_status "$1" "scan" "scrub repaired" $2
@@ -1979,11 +1985,23 @@ function is_pool_scrub_stopped #pool <verbose>
check_pool_status "$1" "scan" "scrub canceled" $2
}
function is_pool_error_scrub_stopped #pool <verbose>
{
check_pool_status "$1" "scrub" "error scrub canceled on " $2
return $?
}
function is_pool_scrub_paused #pool <verbose>
{
check_pool_status "$1" "scan" "scrub paused since " $2
}
function is_pool_error_scrub_paused #pool <verbose>
{
check_pool_status "$1" "scrub" "error scrub paused since " $2
return $?
}
function is_pool_removing #pool
{
check_pool_status "$1" "remove" "in progress since "