add new errors for Disks with timeouts (#17770)

This commit is contained in:
Harshavardhana 2023-08-01 12:47:50 -07:00 committed by GitHub
parent 311380f8cb
commit a7a7533190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 19 deletions

View File

@ -209,6 +209,8 @@ func getDisksInfo(disks []StorageAPI, endpoints []Endpoint) (disksInfo []madmin.
di.Metrics = &madmin.DiskMetrics{ di.Metrics = &madmin.DiskMetrics{
LastMinute: make(map[string]madmin.TimedAction, len(info.Metrics.LastMinute)), LastMinute: make(map[string]madmin.TimedAction, len(info.Metrics.LastMinute)),
APICalls: make(map[string]uint64, len(info.Metrics.APICalls)), APICalls: make(map[string]uint64, len(info.Metrics.APICalls)),
TotalErrorsAvailability: info.Metrics.TotalErrorsAvailability,
TotalErrorsTimeout: info.Metrics.TotalErrorsTimeout,
} }
for k, v := range info.Metrics.LastMinute { for k, v := range info.Metrics.LastMinute {
if v.N > 0 { if v.N > 0 {

View File

@ -243,13 +243,6 @@ func makeBucketLocal(ctx context.Context, bucket string, opts MakeBucketOptions)
} }
errs := g.Wait() errs := g.Wait()
for _, err := range errs {
if err != nil && !IsErr(err, bucketOpIgnoredErrs...) {
logger.LogIf(ctx, err)
}
}
return reduceWriteQuorumErrs(ctx, errs, bucketOpIgnoredErrs, (len(globalLocalDrives)/2)+1) return reduceWriteQuorumErrs(ctx, errs, bucketOpIgnoredErrs, (len(globalLocalDrives)/2)+1)
} }

View File

@ -275,6 +275,10 @@ func (p *xlStorageDiskIDCheck) DiskInfo(ctx context.Context, metrics bool) (info
si := p.updateStorageMetrics(storageMetricDiskInfo) si := p.updateStorageMetrics(storageMetricDiskInfo)
defer si(&err) defer si(&err)
if metrics {
info.Metrics = p.getMetrics()
}
if p.health.isFaulty() { if p.health.isFaulty() {
// if disk is already faulty return faulty for 'mc admin info' output and prometheus alerts. // if disk is already faulty return faulty for 'mc admin info' output and prometheus alerts.
return info, errFaultyDisk return info, errFaultyDisk
@ -285,10 +289,6 @@ func (p *xlStorageDiskIDCheck) DiskInfo(ctx context.Context, metrics bool) (info
return info, err return info, err
} }
if metrics {
info.Metrics = p.getMetrics()
}
// check cached diskID against backend // check cached diskID against backend
// only if its non-empty. // only if its non-empty.
if p.diskID != "" && p.diskID != info.ID { if p.diskID != "" && p.diskID != info.ID {
@ -860,11 +860,10 @@ func (p *xlStorageDiskIDCheck) TrackDiskHealth(ctx context.Context, s storageMet
p.health.tokens <- struct{}{} p.health.tokens <- struct{}{}
if errp != nil { if errp != nil {
err := *errp err := *errp
if err != nil && !errors.Is(err, io.EOF) { if err == nil || errors.Is(err, io.EOF) {
return
}
p.health.logSuccess() p.health.logSuccess()
} }
}
si(errp) si(errp)
}) })
}, nil }, nil

2
go.mod
View File

@ -49,7 +49,7 @@ require (
github.com/minio/dperf v0.5.0 github.com/minio/dperf v0.5.0
github.com/minio/highwayhash v1.0.2 github.com/minio/highwayhash v1.0.2
github.com/minio/kes-go v0.1.0 github.com/minio/kes-go v0.1.0
github.com/minio/madmin-go/v3 v3.0.8 github.com/minio/madmin-go/v3 v3.0.9
github.com/minio/minio-go/v7 v7.0.61 github.com/minio/minio-go/v7 v7.0.61
github.com/minio/mux v1.9.0 github.com/minio/mux v1.9.0
github.com/minio/pkg v1.7.5 github.com/minio/pkg v1.7.5

4
go.sum
View File

@ -485,8 +485,8 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
github.com/minio/kes-go v0.1.0 h1:h201DyOYP5sTqajkxFGxmXz/kPbT8HQNX1uh3Yx2PFc= github.com/minio/kes-go v0.1.0 h1:h201DyOYP5sTqajkxFGxmXz/kPbT8HQNX1uh3Yx2PFc=
github.com/minio/kes-go v0.1.0/go.mod h1:VorHLaIYis9/MxAHAtXN4d8PUMNKhIxTIlvFt0hBOEo= github.com/minio/kes-go v0.1.0/go.mod h1:VorHLaIYis9/MxAHAtXN4d8PUMNKhIxTIlvFt0hBOEo=
github.com/minio/madmin-go/v3 v3.0.8 h1:oY+siBnw7+aJg5Idx2nPguP/10TeLekBTmJiUO+buAI= github.com/minio/madmin-go/v3 v3.0.9 h1:Iel1A4Ab+MWEcX3xPrfmDGy/0z2l/PZkCNxmy/B/kHU=
github.com/minio/madmin-go/v3 v3.0.8/go.mod h1:lPrMoc1aeiIWmmrxBthkDqzMPQwC/Lu9ByuyM2wenJk= github.com/minio/madmin-go/v3 v3.0.9/go.mod h1:lPrMoc1aeiIWmmrxBthkDqzMPQwC/Lu9ByuyM2wenJk=
github.com/minio/mc v0.0.0-20230726035150-6b8680a2f7ca h1:y/dJJuWhlVYN9tqBxoHvGCpJ7olVuPa1whg+GS1m1a8= github.com/minio/mc v0.0.0-20230726035150-6b8680a2f7ca h1:y/dJJuWhlVYN9tqBxoHvGCpJ7olVuPa1whg+GS1m1a8=
github.com/minio/mc v0.0.0-20230726035150-6b8680a2f7ca/go.mod h1:9x/wxYmFZCP+FMVZe57igzxENRGNOFBrucj3m4NqByg= github.com/minio/mc v0.0.0-20230726035150-6b8680a2f7ca/go.mod h1:9x/wxYmFZCP+FMVZe57igzxENRGNOFBrucj3m4NqByg=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=