mirror of
https://github.com/minio/minio.git
synced 2025-03-30 17:23:42 -04:00
fix: skip local disks properly in cluster health maintenance check (#19184)
This commit is contained in:
parent
b69bcdcdc4
commit
1b5f28e99b
@ -2318,8 +2318,19 @@ func (z *erasureServerPools) Health(ctx context.Context, opts HealthOptions) Hea
|
|||||||
storageInfo := z.StorageInfo(ctx, false)
|
storageInfo := z.StorageInfo(ctx, false)
|
||||||
|
|
||||||
for _, disk := range storageInfo.Disks {
|
for _, disk := range storageInfo.Disks {
|
||||||
if disk.Local && opts.Maintenance {
|
if opts.Maintenance {
|
||||||
continue
|
var skip bool
|
||||||
|
globalLocalDrivesMu.RLock()
|
||||||
|
for _, drive := range globalLocalDrives {
|
||||||
|
if drive != nil && drive.Endpoint().String() == disk.Endpoint {
|
||||||
|
skip = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
globalLocalDrivesMu.RUnlock()
|
||||||
|
if skip {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if disk.PoolIndex > -1 && disk.SetIndex > -1 {
|
if disk.PoolIndex > -1 && disk.SetIndex > -1 {
|
||||||
@ -2426,6 +2437,7 @@ func (z *erasureServerPools) Health(ctx context.Context, opts HealthOptions) Hea
|
|||||||
|
|
||||||
if opts.Maintenance {
|
if opts.Maintenance {
|
||||||
result.Healthy = result.Healthy && drivesHealing == 0
|
result.Healthy = result.Healthy && drivesHealing == 0
|
||||||
|
result.HealthyRead = result.HealthyRead && drivesHealing == 0
|
||||||
result.HealingDrives = drivesHealing
|
result.HealingDrives = drivesHealing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user