Skip to content

fix(sysfs): accept delayed mdraid sync_completed state#837

Open
happysnaker wants to merge 1 commit into
prometheus:masterfrom
happysnaker:fix-770-mdraid-delayed-sync-completed
Open

fix(sysfs): accept delayed mdraid sync_completed state#837
happysnaker wants to merge 1 commit into
prometheus:masterfrom
happysnaker:fix-770-mdraid-delayed-sync-completed

Conversation

@happysnaker

Copy link
Copy Markdown

Summary

  • treat sync_completed=delayed as a valid mdraid state instead of failing the entire Mdraids() parse
  • keep numeric progress parsing unchanged for the normal a / b form
  • add a focused regression test that builds a minimal mdraid sysfs tree with sync_completed=delayed

Why

When multiple md arrays share physical devices, Linux can expose sync_completed as delayed while a check or resync is deferred. The current parser only accepts none or a / b, so one delayed array causes sysfs.Mdraids() to fail outright.

This change treats delayed like the existing non-progress sentinel none: there is no numeric completion fraction to parse yet, but callers still get the rest of the array metadata.

Closes #770

Signed-off-by: Shirong Lu <73147033+happysnaker@users.noreply.github.com>
@happysnaker

Copy link
Copy Markdown
Author

Maintainer context: Linux can expose sync_completed as the literal delayed when a check/resync is deferred because another md array sharing the same devices is already syncing. In that state there is no numeric progress fraction to parse yet, but the rest of the array metadata is still valid. This patch therefore treats delayed the same way the parser already treats none: keep returning the mdraid entry instead of failing Mdraids() for the whole scrape.

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.

sysfs.Mdraids() fails if any MD raid array has a delayed check or resync

1 participant