-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix ZED auto-replace for VDEVs using by-id paths #15363
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sponsored-By: OpenDrives Inc. Sponsored-By: Klara Inc. Signed-off-by: Don Brady <[email protected]>
Signed-off-by: Don Brady <[email protected]>
tonyhutter
approved these changes
Oct 19, 2023
robn
approved these changes
Oct 20, 2023
robn
reviewed
Oct 20, 2023
behlendorf
approved these changes
Oct 20, 2023
behlendorf
added
Status: Accepted
Ready to integrate (reviewed, tested)
and removed
Status: Code Review Needed
Ready for review and testing
labels
Oct 20, 2023
ixhamza
pushed a commit
to truenas/zfs
that referenced
this pull request
Nov 20, 2023
The change is simple -- restore the original code so that the VDEV path is updated when using by-id paths. The more challenging part was to devise a second ZTS test, that would test auto-replace for 'by-id' and help prevent a future regression. With that new test, we can now do an A|B test with , and without, the fix to confirm that auto-replace for by-id paths works. The existing auto-replace test, functional/fault/auto_replace_001_pos, will confirm that we didn't break auto-replace for 'by-vdev' paths. In the original functional/fault/auto_replace_001_pos test, the disk wipe (using dd) was not effective in removing the partitioning since the kernel was never informed of the wipe. Added a call to wipefs(8) so that the kernel is informed and ZED will re-partition the device. Added a validation step that the re-partitioning occurred by confirming that the GPT partition UUID changes. Sponsored-By: OpenDrives Inc. Sponsored-By: Klara Inc. Reviewed-by: Rob Norris <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes openzfs#15363
lundman
pushed a commit
to openzfsonwindows/openzfs
that referenced
this pull request
Dec 12, 2023
The change is simple -- restore the original code so that the VDEV path is updated when using by-id paths. The more challenging part was to devise a second ZTS test, that would test auto-replace for 'by-id' and help prevent a future regression. With that new test, we can now do an A|B test with , and without, the fix to confirm that auto-replace for by-id paths works. The existing auto-replace test, functional/fault/auto_replace_001_pos, will confirm that we didn't break auto-replace for 'by-vdev' paths. In the original functional/fault/auto_replace_001_pos test, the disk wipe (using dd) was not effective in removing the partitioning since the kernel was never informed of the wipe. Added a call to wipefs(8) so that the kernel is informed and ZED will re-partition the device. Added a validation step that the re-partitioning occurred by confirming that the GPT partition UUID changes. Sponsored-By: OpenDrives Inc. Sponsored-By: Klara Inc. Reviewed-by: Rob Norris <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes openzfs#15363
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
The ZFS auto-replace mechanism will detect a blank disk inserted for a degraded/faulted VDEV and automatically partition the disk and issue a VDEV replacement.
There are two different
/dev/disk/by-xxx
paths involved, aby-id
and aby-vdev
.In the 'by-vdev' case, the path is both a persistent and physical path.
In the 'by-id' case, the path is persistent and also a unique path.
During an auto-replace, the newly partition disk will have a different 'by-id' name, however the 'by-vdev' name will not change.
A regression in the distant past, changed the ZED auto-replace code such that it is attempting to use the old 'by-id' name during the replacement but that name no longer exists in the 'by-id' namespace. This causes the auto-replace operation to fail.
Note that since the 'by-vdev' names don't change, it's perfectly fine to use the previous VDEV path when dev paths are 'by-vdev'.
Description
The change is simple -- restore the original code so that the VDEV path is updated when using by-id paths.
The more challenging part was to devise a second ZTS test, that would test auto-replace for 'by-id' and help prevent a future regression.
With that new test, we can now do an A|B test with , and without, the fix to confirm that auto-replace for by-id paths works. The existing auto-replace test,
functional/fault/auto_replace_001_pos
, will confirm that we didn't break auto-replace for 'by-vdev' paths.In the original
functional/fault/auto_replace_001_pos test
, the disk wipe (usingdd
) was not effective in removing the partitioning since the kernel was never informed of the wipe.wipefs(8)
so that the kernel is informed and ZED will re-partition the device.Sponsored-By: OpenDrives Inc.
Sponsored-By: Klara Inc.
How Has This Been Tested?
ZTS
functional/fault
testsAudit ZED logging from the tests to confirm that ZED auto-replace was functioning as expected.
Types of changes
Checklist:
Signed-off-by
.