mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
report heal drives properly, also from global state (#10561)
It is possible the heal drives are not reported from the maintenance check because the background heal state simply relied on the `format.json` for capturing unformatted drives. It is possible that drives might be still healing - make sure that applications which rely on cluster health check respond back this detail.
This commit is contained in:
parent
e6ab4db6b8
commit
3cac262dd1
@ -66,19 +66,26 @@ func getLocalBackgroundHealStatus() (madmin.BgHealState, bool) {
|
|||||||
if globalBackgroundHealState == nil {
|
if globalBackgroundHealState == nil {
|
||||||
return madmin.BgHealState{}, false
|
return madmin.BgHealState{}, false
|
||||||
}
|
}
|
||||||
|
|
||||||
bgSeq, ok := globalBackgroundHealState.getHealSequenceByToken(bgHealingUUID)
|
bgSeq, ok := globalBackgroundHealState.getHealSequenceByToken(bgHealingUUID)
|
||||||
if !ok {
|
if !ok {
|
||||||
return madmin.BgHealState{}, false
|
return madmin.BgHealState{}, false
|
||||||
}
|
}
|
||||||
|
|
||||||
objAPI := newObjectLayerWithoutSafeModeFn()
|
var healDisksMap = map[string]struct{}{}
|
||||||
if objAPI == nil {
|
for _, ep := range getLocalDisksToHeal() {
|
||||||
return madmin.BgHealState{}, false
|
healDisksMap[ep.String()] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, ep := range globalBackgroundHealState.getHealLocalDisks() {
|
||||||
|
if _, ok := healDisksMap[ep.String()]; !ok {
|
||||||
|
healDisksMap[ep.String()] = struct{}{}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var healDisks []string
|
var healDisks []string
|
||||||
for _, ep := range getLocalDisksToHeal() {
|
for disk := range healDisksMap {
|
||||||
healDisks = append(healDisks, ep.String())
|
healDisks = append(healDisks, disk)
|
||||||
}
|
}
|
||||||
|
|
||||||
return madmin.BgHealState{
|
return madmin.BgHealState{
|
||||||
|
Loading…
Reference in New Issue
Block a user