Skip to content

fix mdadm#1036

Merged
cgalibern merged 2 commits into
opensvc:mainfrom
cgalibern:fix-mdadm
May 29, 2026
Merged

fix mdadm#1036
cgalibern merged 2 commits into
opensvc:mainfrom
cgalibern:fix-mdadm

Conversation

@cgalibern
Copy link
Copy Markdown
Contributor

No description provided.

…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.
@cgalibern cgalibern marked this pull request as draft May 27, 2026 14:54
@cgalibern cgalibern marked this pull request as ready for review May 27, 2026 16:47
@cgalibern cgalibern merged commit b805799 into opensvc:main May 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant