mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
fix: capture disks when entire peer is offline (#11697)
currently when one of the peer is down, the drives from that peer are reported as '0/0' offline instead we should capture/filter the drives from the peer and populate it appropriately such that `mc admin info` displays correct info.
This commit is contained in:
parent
7be7109471
commit
786585009e
@ -1218,6 +1218,21 @@ func (sys *NotificationSys) ProcInfo(ctx context.Context) []madmin.ServerProcInf
|
|||||||
return reply
|
return reply
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getOfflineDisks(offlineHost string, endpoints EndpointServerPools) []madmin.Disk {
|
||||||
|
var offlineDisks []madmin.Disk
|
||||||
|
for _, pool := range endpoints {
|
||||||
|
for _, ep := range pool.Endpoints {
|
||||||
|
if offlineHost == ep.Host {
|
||||||
|
offlineDisks = append(offlineDisks, madmin.Disk{
|
||||||
|
Endpoint: ep.String(),
|
||||||
|
State: string(madmin.ItemOffline),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return offlineDisks
|
||||||
|
}
|
||||||
|
|
||||||
// ServerInfo - calls ServerInfo RPC call on all peers.
|
// ServerInfo - calls ServerInfo RPC call on all peers.
|
||||||
func (sys *NotificationSys) ServerInfo() []madmin.ServerProperties {
|
func (sys *NotificationSys) ServerInfo() []madmin.ServerProperties {
|
||||||
reply := make([]madmin.ServerProperties, len(sys.peerClients))
|
reply := make([]madmin.ServerProperties, len(sys.peerClients))
|
||||||
@ -1233,6 +1248,7 @@ func (sys *NotificationSys) ServerInfo() []madmin.ServerProperties {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
info.Endpoint = client.host.String()
|
info.Endpoint = client.host.String()
|
||||||
info.State = string(madmin.ItemOffline)
|
info.State = string(madmin.ItemOffline)
|
||||||
|
info.Disks = getOfflineDisks(info.Endpoint, globalEndpoints)
|
||||||
} else {
|
} else {
|
||||||
info.State = string(madmin.ItemOnline)
|
info.State = string(madmin.ItemOnline)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user