fix: do not heal when disks are down (#12186)

HeadObject() was erroneously attempting
a heal when disks are down, avoid it.
This commit is contained in:
Harshavardhana
2021-04-29 09:54:16 -07:00
committed by GitHub
parent b3c8a1864f
commit 336c8ac99f
2 changed files with 14 additions and 0 deletions

View File

@@ -433,6 +433,12 @@ func (er erasureObjects) getObjectFileInfo(ctx context.Context, bucket, object s
return fi, nil, nil, err
}
// if one of the disk is offline, return right here no need
// to attempt a heal on the object.
if countErrs(errs, errDiskNotFound) > 0 {
return fi, metaArr, onlineDisks, nil
}
var missingBlocks int
for i, err := range errs {
if err != nil && errors.Is(err, errFileNotFound) {