Repository navigation
fix: ensure udev sees md raid member formats after array creation - #700
Conversation
Cause: The md member superblocks are written by mdadm when the RAID array is created, after the blivet module's ensure_udev_update callback has already triggered udev change events for the members (when the "create format mdmember" actions executed, before the superblocks existed). If the kernel-generated change uevents for the members are lost, the udev database for a member will not show it as a linux_raid_member, and a subsequent run of the role will not recognize the member as part of the array. blivet will then treat the member as an unformatted partition and schedule destructive actions (destroying and recreating the array), failing with "Partition(s) 1 on /dev/sdb have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use." Consequences: Re-running the role (the idempotence check in tests_create_raid_volume_then_remove.yml, or a user re-applying a playbook) intermittently fails on CentOS Stream 9 (blivet 3.6.0). With storage_safe_mode: false the second run even wipes the md superblock from the in-use member before failing. Fix: In the blivet module's ensure_udev_update action callback, when the action device is an MDRaidArrayDevice, also trigger a udev change event for each member device after the array is created. blivet >= 3.12.0 does this in MDRaidArrayDevice._create() (upstream commit 8f0585933d); the module now does the equivalent so the role works with older versions of blivet. Result: The udev database is updated for all md array members immediately after the array is created, so subsequent runs recognize the members as part of the array and remain idempotent. Assisted-by: goose using model(s) glm-5-3 Signed-off-by: Rich Megginson <rmeggins@redhat.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
CI tests do not run automatically on pull requests. A role repository See GitHub CI testing using /citest Run every available CI workflow: Run the linting and other lightweight checks: Run the integration tests (QEMU/container and Testing Farm): Run one or more selected workflows by separating their names with spaces:
Post another |
|
/citest all |
Cause: The md member superblocks are written by mdadm when the RAID
array is created, after the blivet module's ensure_udev_update callback
has already triggered udev change events for the members (when the
"create format mdmember" actions executed, before the superblocks
existed). If the kernel-generated change uevents for the members are
lost, the udev database for a member will not show it as a
linux_raid_member, and a subsequent run of the role will not recognize
the member as part of the array. blivet will then treat the member as
an unformatted partition and schedule destructive actions (destroying
and recreating the array), failing with "Partition(s) 1 on /dev/sdb
have been written, but we have been unable to inform the kernel of the
change, probably because it/they are in use."
Consequences: Re-running the role (the idempotence check in
tests_create_raid_volume_then_remove.yml, or a user re-applying a
playbook) intermittently fails on CentOS Stream 9 (blivet 3.6.0). With
storage_safe_mode: false the second run even wipes the md superblock
from the in-use member before failing.
Fix: In the blivet module's ensure_udev_update action callback, when
the action device is an MDRaidArrayDevice, also trigger a udev change
event for each member device after the array is created. blivet >=
3.12.0 does this in MDRaidArrayDevice._create() (upstream commit
8f0585933d); the module now does the equivalent so the role works with
older versions of blivet.
Result: The udev database is updated for all md array members
immediately after the array is created, so subsequent runs recognize
the members as part of the array and remain idempotent.
Assisted-by: goose using model(s) glm-5-3
Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by CodeRabbit