mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -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 {
|
||||
return madmin.BgHealState{}, false
|
||||
}
|
||||
|
||||
bgSeq, ok := globalBackgroundHealState.getHealSequenceByToken(bgHealingUUID)
|
||||
if !ok {
|
||||
return madmin.BgHealState{}, false
|
||||
}
|
||||
|
||||
objAPI := newObjectLayerWithoutSafeModeFn()
|
||||
if objAPI == nil {
|
||||
return madmin.BgHealState{}, false
|
||||
var healDisksMap = map[string]struct{}{}
|
||||
for _, ep := range getLocalDisksToHeal() {
|
||||
healDisksMap[ep.String()] = struct{}{}
|
||||
}
|
||||
|
||||
for _, ep := range globalBackgroundHealState.getHealLocalDisks() {
|
||||
if _, ok := healDisksMap[ep.String()]; !ok {
|
||||
healDisksMap[ep.String()] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
var healDisks []string
|
||||
for _, ep := range getLocalDisksToHeal() {
|
||||
healDisks = append(healDisks, ep.String())
|
||||
for disk := range healDisksMap {
|
||||
healDisks = append(healDisks, disk)
|
||||
}
|
||||
|
||||
return madmin.BgHealState{
|
||||
|
Loading…
Reference in New Issue
Block a user