-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support single files scrubbing #16018
base: master
Are you sure you want to change the base?
Conversation
80cb074
to
adca54a
Compare
tests/zfs-tests/tests/functional/cli_root/zfs_scrub/zfs_error_scrub_001_pos.ksh
Outdated
Show resolved
Hide resolved
tests/zfs-tests/tests/functional/cli_root/zfs_scrub/zfs_error_scrub_002_pos.ksh
Outdated
Show resolved
Hide resolved
tests/zfs-tests/tests/functional/cli_root/zfs_scrub/zfs_error_scrub_001_pos.ksh
Outdated
Show resolved
Hide resolved
tests/zfs-tests/tests/functional/cli_root/zfs_scrub/zfs_error_scrub_001_pos.ksh
Show resolved
Hide resolved
tests/zfs-tests/tests/functional/cli_root/zfs_scrub/zfs_scrub.cfg
Outdated
Show resolved
Hide resolved
adca54a
to
e9fe04c
Compare
|
Yes, I can do that.
Ok, I can try to add such.
The file will be added to the error list; however, the scrub will fail, as you can't start another scrub. |
Just so I'm understanding correctly - if I do:
...the And conversely, if I do:
The If this is correct, then we should print an error in both cases saying something to the effect of "I can't do that, there's a scrub in progress". We should mention this behavior in the man pages as well. Some other scenarios that come to mind:
|
e9fe04c
to
d453d4e
Compare
Yes, that is correct. You will see the file on error list.
Yes, as there is already a running scrub.
I have added that only one scrub can work.
So currently the file will be added to the error list and the scrub will be still paused.
Yes, its a normal scrub it behaves the same. |
This introduces the functionality of scrubbing data from files. Originally, the `errloglist` structure was utilized for tracking error blocks identified during scrub operations. Same structure can be used record blocks from specific files. By generating these records we can simbply scurb it. This allows scrubbing a single file, leveraging existing infrastructure. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: Mariusz Zaborski <[email protected]>
d453d4e
to
1512020
Compare
log_must zinject -a -t data -C 0,1 -e io $mntpnt/file | ||
|
||
log_must zfs scrub $mntpnt/file | ||
log_must is_pool_without_errors $TESTPOOL true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the test corrupts the first two DVAs of $mntpnt/file
then I would expect scrub to say "I repaired data" rather than "everything was fine". Does this check that scrub repaired data here?
|
||
function is_pool_without_errors #pool <verbose> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this return true if there were no errors, or does it return true if there were errors but they were all repaired?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were there are no more known errors.
Hmm.. I'm worried that the user will think their files are corrupted when they really arn't. Is there a way around that? Also, minor typo in commit message:
Lastly, are you planning to add delegation support for |
We could either create a separate list for such files or add some flags that indicate that file was added manually (however I think this would require the changes on disk format).
The user who has access to the file can scrub it. So I didn't think about doing a delegation. |
Unfortunately, I think we would have to do this. We don't want the user to see files flagged in
This has some unfortunate side effects. The unprivileged user would be able to start a scrub on their files, but they wouldn't be able to pause or cancel the scrub, which seems like something they should be able to do. An unprivilaged user could also do:
... and prevent anyone else from doing a scrub of anything (including the admin's "monthly scrub cron job"). I get that it makes sense to make this a |
I will try to figure out something.
No I don't have. However, conceptually I like that this scrub is separated from the "global scrub". Maybe we can simply do a zfs scrub a part of zpool scrub permissions set? So if you can run zpool scrub, you can also run zfs scrub. |
Can I ask the progress of this? Scrubbing a file (or even a dataset, see other PR) would be a pretty great feature since subbing really big pools is time consuming. If this got landed, it is imaginable that Klara, Inc. or Wasabi Technology, Inc. also sponsoring to finish the dataset-wide scrubbing? In any case much thanks. |
@jumbi77 I have switched to another task (the scrub range), although the plan is to add it sooner then later. Probably with a second errlist for the files that have been ordered manually. |
@oshogbo Can I may ask the status of this? Just sharing my thoughts that for many users a file-based and also dataset-based ( #7257 ) would be awesome for many zfs users. In any case much thanks for the work! |
Motivation and Context
Currently, we have various scrubbing approaches, including scrubbing an entire pool or scrubbing saved errors. However, the ability to target specific data for scrubbing can be particularly beneficial. For instance, one simple application of this is scrubbing a single file rather than the entire pool. One of the simplest examples is to scrub a single file instead of the whole pool. This scrubbing could be desired for files written prior to disk/controller errors or for older files that warrant inspection. For a large pools limiting the actual data that we have scrub can be quite usefull.
Description
This introduces the functionality of scrubbing data from files. Originally, the
errloglist
structure was utilized for tracking error blocks identified during scrub operations. Same structure can be used record blocks from specific files. By generating these records we can simbply scurb it. This allows scrubbing a single file, leveraging existing infrastructure.Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
How Has This Been Tested?
A new test was added.
Types of changes
Checklist:
Signed-off-by
.