From 5ea629beb2052c21618ffab96d77add1429735db Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 2 Sep 2022 12:47:17 -0700 Subject: [PATCH] avoid printing io.ErrUnexpectedEOF for .metacache objects (#15642) --- cmd/erasure-object.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/cmd/erasure-object.go b/cmd/erasure-object.go index facc14fbb..affa60830 100644 --- a/cmd/erasure-object.go +++ b/cmd/erasure-object.go @@ -502,17 +502,26 @@ func readAllXL(ctx context.Context, disks []StorageAPI, bucket, object string, r }, index) } + ignoredErrs := []error{ + errFileNotFound, + errVolumeNotFound, + errFileVersionNotFound, + errDiskNotFound, + } + errs := g.Wait() for index, err := range errs { if err == nil { continue } - if !IsErr(err, []error{ - errFileNotFound, - errVolumeNotFound, - errFileVersionNotFound, - errDiskNotFound, - }...) { + if bucket == minioMetaBucket { + // minioMetaBucket "reads" for .metacache are not written with O_SYNC + // so there is a potential for them to not fully committed to stable + // storage leading to unexpected EOFs. Allow these failures to + // be ignored since the caller already ignores them in streamMetadataParts() + ignoredErrs = append(ignoredErrs, io.ErrUnexpectedEOF, io.EOF) + } + 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())