Skip to content

fix: handle 'delayed' state in sync_completed parsing#786

Open
mehrdadbn9 wants to merge 2 commits intoprometheus:masterfrom
mehrdadbn9:fix/sync-completed-delayed
Open

fix: handle 'delayed' state in sync_completed parsing#786
mehrdadbn9 wants to merge 2 commits intoprometheus:masterfrom
mehrdadbn9:fix/sync-completed-delayed

Conversation

@mehrdadbn9
Copy link

Summary

  • Handle delayed as a special value in sync_completed parsing (similar to none)
  • When multiple MD RAID arrays share physical devices and a check/resync is triggered for more than one, the kernel delays the action on all but one device
  • In this case, sync_completed contains delayed instead of none or N / M

Problem

The current code fails when sync_completed contains delayed:

error parsing mdraids: expected integer

Solution

Add delayed to the list of special values that should not be parsed as integers.

Testing

  • Tested with manual test cases: none, delayed, 123 / 456, invalid
  • All cases handled correctly

Fixes #770
Related: prometheus/node_exporter#3500

When multiple MD RAID arrays share physical devices and a check/resync
is triggered for more than one, the kernel delays the action on all
but one device. In this case, sync_completed contains 'delayed'
instead of 'none' or 'N / M'.

This fix adds 'delayed' to the list of special values that should
not be parsed as integers.

Fixes prometheus#770
Related: prometheus/node_exporter#3500
- Add TestMdraidDelayedSyncCompleted to verify delayed state handling
- Include complete test data with delayed sync_completed value
- Test verifies SyncCompleted=0, SyncAction='resync', and all component states

Fixes prometheus#786
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