Skip to content

Commit 99aa4c8

Browse files
oshogboPaul Dagnelie
authored andcommitted
Add ability to scrub from last scrubbed txg
Some users might want to scrub only new data because they would like to know if the new write wasn't corrupted. This PR adds possibility scrub only newly written data. This introduces new `last_scrubbed_txg` property, indicating the transaction group (TXG) up to which the most recent scrub operation has checked and repaired the dataset, so users can run scrub only from the last saved point. We use a scn_max_txg and scn_min_txg which are already built into scrub, to accomplish that. Reviewed-by: Allan Jude <allan@klarasystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Mariusz Zaborski <mariusz.zaborski@klarasystems.com> Sponsored-By: Wasabi Technology, Inc. Sponsored-By: Klara Inc. Closes openzfs#16301
1 parent 3f26884 commit 99aa4c8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmd/zpool/zpool_main.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8458,6 +8458,18 @@ zpool_do_scrub(int argc, char **argv)
84588458
(void) fprintf(stderr, gettext("invalid option "
84598459
"combination: -e and -C are mutually exclusive\n"));
84608460
usage(B_FALSE);
8461+
} else if (is_pause && is_txg_continue) {
8462+
(void) fprintf(stderr, gettext("invalid option "
8463+
"combination :-p and -C are mutually exclusive\n"));
8464+
usage(B_FALSE);
8465+
} else if (is_stop && is_txg_continue) {
8466+
(void) fprintf(stderr, gettext("invalid option "
8467+
"combination :-s and -C are mutually exclusive\n"));
8468+
usage(B_FALSE);
8469+
} else if (is_error_scrub && is_txg_continue) {
8470+
(void) fprintf(stderr, gettext("invalid option "
8471+
"combination :-e and -C are mutually exclusive\n"));
8472+
usage(B_FALSE);
84618473
} else {
84628474
if (is_error_scrub)
84638475
cb.cb_type = POOL_SCAN_ERRORSCRUB;

0 commit comments

Comments
 (0)