fix mdadm#1036
Merged
Merged
Conversation
…ices
This commit tries to fix unexpected long time that may occur during the
resource disk.md status refresh (so during initial service creation, or
for all disk.md resource status evaluation).
The orevious RAID device detection was performed from the 'mdadm --examine --scan --verbose' command.
But the command issue too many IOs and can take too much time:
Example on RHEL9:
$ time sudo mdadm --examine --scan --verbose
ARRAY /dev/md/c19mdadm.disk.10 level=raid1 metadata=1.2 num-devices=2 UUID=3ea52438:8c0670a9:8becfe02:8a931a3c
devices=/dev/dm-6,/dev/dm-5,/dev/sdn,/dev/sdl,/dev/sdi,/dev/sdh
ARRAY /dev/md/c19mdadm.disk.11 level=raid1 metadata=1.2 num-devices=2 UUID=403e5acb:4869257f:381bb1b0:816d61b9
devices=/dev/dm-11,/dev/dm-9,/dev/sdt,/dev/sdq,/dev/sdm,/dev/sdk
real 0m44.877s
user 0m0.017s
sys 0m0.026s
With this commit, the RAID devices detection is done from the output
of the command: `blkid -t TYPE=linux_raid_member`:
- Introduced `blkidOutput` to retrieve device information using `blkid`.
- Replaced `examineScanVerbose` with `blkidOutput` for UUID and device resolutions.
- Added `AsBlkID` and refactored `ContainsUUIDOrName` for improved UUID handling.
- Modified device detection logic to resolve symlinks for accurate results.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.