From a7a7533190498ae629fe59991b967f53e3d3838d Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 1 Aug 2023 12:47:50 -0700 Subject: [PATCH] add new errors for Disks with timeouts (#17770) --- cmd/erasure.go | 6 ++++-- cmd/peer-s3-server.go | 7 ------- cmd/xl-storage-disk-id-check.go | 13 ++++++------- go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/cmd/erasure.go b/cmd/erasure.go index b10dccc6f..a2d569bae 100644 --- a/cmd/erasure.go +++ b/cmd/erasure.go @@ -207,8 +207,10 @@ func getDisksInfo(disks []StorageAPI, endpoints []Endpoint) (disksInfo []madmin. } } di.Metrics = &madmin.DiskMetrics{ - LastMinute: make(map[string]madmin.TimedAction, len(info.Metrics.LastMinute)), - APICalls: make(map[string]uint64, len(info.Metrics.APICalls)), + LastMinute: make(map[string]madmin.TimedAction, len(info.Metrics.LastMinute)), + APICalls: make(map[string]uint64, len(info.Metrics.APICalls)), + TotalErrorsAvailability: info.Metrics.TotalErrorsAvailability, + TotalErrorsTimeout: info.Metrics.TotalErrorsTimeout, } for k, v := range info.Metrics.LastMinute { if v.N > 0 { diff --git a/cmd/peer-s3-server.go b/cmd/peer-s3-server.go index fdf1661ad..48aff7f11 100644 --- a/cmd/peer-s3-server.go +++ b/cmd/peer-s3-server.go @@ -243,13 +243,6 @@ func makeBucketLocal(ctx context.Context, bucket string, opts MakeBucketOptions) } 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) } diff --git a/cmd/xl-storage-disk-id-check.go b/cmd/xl-storage-disk-id-check.go index 24758a241..b237f09f7 100644 --- a/cmd/xl-storage-disk-id-check.go +++ b/cmd/xl-storage-disk-id-check.go @@ -275,6 +275,10 @@ func (p *xlStorageDiskIDCheck) DiskInfo(ctx context.Context, metrics bool) (info si := p.updateStorageMetrics(storageMetricDiskInfo) defer si(&err) + if metrics { + info.Metrics = p.getMetrics() + } + if p.health.isFaulty() { // if disk is already faulty return faulty for 'mc admin info' output and prometheus alerts. return info, errFaultyDisk @@ -285,10 +289,6 @@ func (p *xlStorageDiskIDCheck) DiskInfo(ctx context.Context, metrics bool) (info return info, err } - if metrics { - info.Metrics = p.getMetrics() - } - // check cached diskID against backend // only if its non-empty. if p.diskID != "" && p.diskID != info.ID { @@ -860,10 +860,9 @@ func (p *xlStorageDiskIDCheck) TrackDiskHealth(ctx context.Context, s storageMet p.health.tokens <- struct{}{} if errp != nil { err := *errp - if err != nil && !errors.Is(err, io.EOF) { - return + if err == nil || errors.Is(err, io.EOF) { + p.health.logSuccess() } - p.health.logSuccess() } si(errp) }) diff --git a/go.mod b/go.mod index 9fff72351..856fca61a 100644 --- a/go.mod +++ b/go.mod @@ -49,7 +49,7 @@ require ( github.com/minio/dperf v0.5.0 github.com/minio/highwayhash v1.0.2 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/mux v1.9.0 github.com/minio/pkg v1.7.5 diff --git a/go.sum b/go.sum index 1c2063fd8..194892db1 100644 --- a/go.sum +++ b/go.sum @@ -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/kes-go v0.1.0 h1:h201DyOYP5sTqajkxFGxmXz/kPbT8HQNX1uh3Yx2PFc= 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.8/go.mod h1:lPrMoc1aeiIWmmrxBthkDqzMPQwC/Lu9ByuyM2wenJk= +github.com/minio/madmin-go/v3 v3.0.9 h1:Iel1A4Ab+MWEcX3xPrfmDGy/0z2l/PZkCNxmy/B/kHU= +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/go.mod h1:9x/wxYmFZCP+FMVZe57igzxENRGNOFBrucj3m4NqByg= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=