From 02c2ec302701a53bacdaa9201470ac7a883026ff Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 20 Jun 2023 13:18:24 -0700 Subject: [PATCH] skip onlineDisks with parity mismatch (#17478) --- cmd/erasure-object.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/cmd/erasure-object.go b/cmd/erasure-object.go index 270c2ffa0..9e675f769 100644 --- a/cmd/erasure-object.go +++ b/cmd/erasure-object.go @@ -691,9 +691,20 @@ func (er erasureObjects) getObjectFileInfo(ctx context.Context, bucket, object s missingBlocks++ continue } - if metaArr[i].IsValid() && metaArr[i].ModTime.Equal(modTime) { - continue - } + + // verify metadata is valid, it has similar erasure info + // as well as common modtime, if modtime is not possible + // verify if it has common "etag" atleast. + if metaArr[i].IsValid() && metaArr[i].Erasure.Equal(fi.Erasure) { + ok := metaArr[i].ModTime.Equal(modTime) + if modTime.IsZero() || modTime.Equal(timeSentinel) { + ok = etag != "" && etag == fi.Metadata["etag"] + } + if ok { + continue + } + } // in all other cases metadata is corrupt, do not read from it. + metaArr[i] = FileInfo{} onlineDisks[i] = nil missingBlocks++