skip onlineDisks with parity mismatch (#17478)

This commit is contained in:
Harshavardhana 2023-06-20 13:18:24 -07:00 committed by GitHub
parent 65c31fab12
commit 02c2ec3027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -691,9 +691,20 @@ func (er erasureObjects) getObjectFileInfo(ctx context.Context, bucket, object s
missingBlocks++ missingBlocks++
continue 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{} metaArr[i] = FileInfo{}
onlineDisks[i] = nil onlineDisks[i] = nil
missingBlocks++ missingBlocks++