prometheus / prometheus/procfs

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

Open
#770 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
883
Forks
388
Avg merge
13h 28m
Merged PRs (30d)
3

Description

If you have multiple software RAID arrays that share physical devices and you trigger a check or a resync for more than one of them, the Linux kernel MD layer notices this situation and normally delays the action on all but one device. For example:

Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid1 sdb2[0] sda2[1]
      972946432 blocks super 1.2 [2/2] [UU]
      [=========>...........]  check = 45.5% (442910144/972946432) finish=55.6min speed=158752K/sec
      bitmap: 2/8 pages [8KB], 65536KB chunk

md1 : active raid1 sdb3[0] sda3[1]
      3677184 blocks super 1.2 [2/2] [UU]
        resync=DELAYED
      
unused devices: <none>

When this is happening, /sys/block/md*/md/sync_completed will contain 'delayed' for any delayed arrays. This causes sysfs.Mdraids() to incorrectly fail, as the code assumes that sync_completed will contain either 'none' or '%d / %d', and attempting to parse 'completed' as the latter returns an 'expected integer' error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the sysfs.Mdraids() entry point and inspect how sync_completed values are parsed. Reproduce the delayed-array case described in the issue, then verify that delayed arrays no longer cause parsing to fail while normal none and completed/total values retain their existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.