diff --git a/cmd/bitrot-streaming.go b/cmd/bitrot-streaming.go index 5f5d99200..3978a56b6 100644 --- a/cmd/bitrot-streaming.go +++ b/cmd/bitrot-streaming.go @@ -24,6 +24,7 @@ import ( "fmt" "hash" "io" + "strings" "sync" xhttp "github.com/minio/minio/internal/http" @@ -146,16 +147,28 @@ func (b *streamingBitrotReader) ReadAt(buf []byte, offset int64) (int, error) { // Can never happen unless there are programmer bugs return 0, errUnexpected } + ignoredErrs := []error{ + errDiskNotFound, + } + if strings.HasPrefix(b.volume, minioMetaBucket) { + ignoredErrs = append(ignoredErrs, + errFileNotFound, + errVolumeNotFound, + errFileVersionNotFound, + ) + } if b.rc == nil { // For the first ReadAt() call we need to open the stream for reading. b.currOffset = offset streamOffset := (offset/b.shardSize)*int64(b.h.Size()) + offset if len(b.data) == 0 && b.tillOffset != streamOffset { b.rc, err = b.disk.ReadFileStream(context.TODO(), b.volume, b.filePath, streamOffset, b.tillOffset-streamOffset) - if err != nil && err != errDiskNotFound { - logger.LogIf(GlobalContext, - fmt.Errorf("Reading erasure shards at (%s: %s/%s) returned '%w', will attempt to reconstruct if we have quorum", - b.disk, b.volume, b.filePath, err)) + if err != nil { + if !IsErr(err, ignoredErrs...) { + logger.LogIf(GlobalContext, + fmt.Errorf("Reading erasure shards at (%s: %s/%s) returned '%w', will attempt to reconstruct if we have quorum", + b.disk, b.volume, b.filePath, err)) + } } } else { b.rc = io.NewSectionReader(bytes.NewReader(b.data), streamOffset, b.tillOffset-streamOffset) diff --git a/cmd/data-scanner.go b/cmd/data-scanner.go index 2ebb2cebf..e8f949c52 100644 --- a/cmd/data-scanner.go +++ b/cmd/data-scanner.go @@ -938,7 +938,10 @@ func (i *scannerItem) applyHealing(ctx context.Context, o ObjectLayer, oi Object ScanMode: scanMode, } res, err := o.HealObject(ctx, i.bucket, i.objectPath(), oi.VersionID, healOpts) - if err != nil && !errors.Is(err, NotImplemented{}) { + if err != nil { + if errors.Is(err, NotImplemented{}) || isErrObjectNotFound(err) || isErrVersionNotFound(err) { + err = nil + } logger.LogIf(ctx, err) return 0 } diff --git a/cmd/erasure-metadata-utils.go b/cmd/erasure-metadata-utils.go index b76625b4f..c2f14594e 100644 --- a/cmd/erasure-metadata-utils.go +++ b/cmd/erasure-metadata-utils.go @@ -22,6 +22,8 @@ import ( "errors" "fmt" "hash/crc32" + "io" + "strings" "github.com/minio/minio/internal/logger" "github.com/minio/minio/internal/sync/errgroup" @@ -165,18 +167,23 @@ func readAllFileInfo(ctx context.Context, disks []StorageAPI, bucket, object, ve }, index) } + ignoredErrs := []error{ + errFileNotFound, + errVolumeNotFound, + errFileVersionNotFound, + errDiskNotFound, + errUnformattedDisk, + } + if strings.HasPrefix(bucket, minioMetaBucket) { + // listing object might be truncated, ignore such errors from logging. + ignoredErrs = append(ignoredErrs, io.ErrUnexpectedEOF) + } errs := g.Wait() for index, err := range errs { if err == nil { continue } - if !IsErr(err, []error{ - errFileNotFound, - errVolumeNotFound, - errFileVersionNotFound, - errDiskNotFound, - errUnformattedDisk, - }...) { + if !IsErr(err, ignoredErrs...) { logger.LogOnceIf(ctx, fmt.Errorf("Drive %s, path (%s/%s) returned an error (%w)", disks[index], bucket, object, err), disks[index].String()) diff --git a/cmd/metacache-server-pool.go b/cmd/metacache-server-pool.go index b24c98560..3cb1522fa 100644 --- a/cmd/metacache-server-pool.go +++ b/cmd/metacache-server-pool.go @@ -375,7 +375,9 @@ func (es *erasureSingle) listPath(ctx context.Context, o *listPathOptions) (entr entries.truncate(0) o.ID = "" if err != nil { - logger.LogIf(ctx, fmt.Errorf("Resuming listing from drives failed %w, proceeding to do raw listing", err)) + if !(isErrObjectNotFound(err) || errors.Is(err, IncompleteBody{}) || isErrVersionNotFound(err)) { + logger.LogIf(ctx, fmt.Errorf("Resuming listing from drives failed %w, proceeding to do raw listing", err)) + } } }