avoid double logging from healing (#17950)

This commit is contained in:
Harshavardhana 2023-08-30 18:46:04 -07:00 committed by GitHub
parent 0ce9e00ffa
commit 9458485e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 19 deletions

View File

@ -902,15 +902,11 @@ func (i *scannerItem) applyHealing(ctx context.Context, o ObjectLayer, oi Object
Remove: healDeleteDangling, Remove: healDeleteDangling,
ScanMode: scanMode, ScanMode: scanMode,
} }
res, err := o.HealObject(ctx, i.bucket, i.objectPath(), oi.VersionID, healOpts) res, _ := o.HealObject(ctx, i.bucket, i.objectPath(), oi.VersionID, healOpts)
if err != nil { if res.ObjectSize > 0 {
if errors.Is(err, NotImplemented{}) || isErrObjectNotFound(err) || isErrVersionNotFound(err) {
err = nil
}
logger.LogIf(ctx, err)
return 0
}
return res.ObjectSize return res.ObjectSize
}
return 0
} }
func (i *scannerItem) applyLifecycle(ctx context.Context, o ObjectLayer, oi ObjectInfo) (applied bool, size int64) { func (i *scannerItem) applyLifecycle(ctx context.Context, o ObjectLayer, oi ObjectInfo) (applied bool, size int64) {

View File

@ -347,13 +347,6 @@ func disksWithAllParts(ctx context.Context, onlineDisks []StorageAPI, partsMetad
dataErrs[i] = errFileCorrupt dataErrs[i] = errFileCorrupt
continue continue
} }
// Since erasure.Distribution is trustable we can fix the mismatching erasure.Index
if meta.Erasure.Distribution[i] != meta.Erasure.Index {
partsMetadata[i] = FileInfo{}
dataErrs[i] = errFileCorrupt
continue
}
} }
} }

View File

@ -101,7 +101,6 @@ func (er erasureObjects) listAndHeal(bucket, prefix string, healEntry func(strin
reportNotFound: false, reportNotFound: false,
agreed: func(entry metaCacheEntry) { agreed: func(entry metaCacheEntry) {
if err := healEntry(bucket, entry); err != nil { if err := healEntry(bucket, entry); err != nil {
logger.LogIf(ctx, err)
cancel() cancel()
} }
}, },
@ -114,7 +113,6 @@ func (er erasureObjects) listAndHeal(bucket, prefix string, healEntry func(strin
} }
if err := healEntry(bucket, *entry); err != nil { if err := healEntry(bucket, *entry); err != nil {
logger.LogIf(ctx, err)
cancel() cancel()
return return
} }
@ -752,7 +750,6 @@ func (er *erasureObjects) healObject(ctx context.Context, bucket string, object
// Attempt a rename now from healed data to final location. // Attempt a rename now from healed data to final location.
partsMetadata[i].SetHealing() partsMetadata[i].SetHealing()
if _, err = disk.RenameData(ctx, minioMetaTmpBucket, tmpID, partsMetadata[i], bucket, object); err != nil { if _, err = disk.RenameData(ctx, minioMetaTmpBucket, tmpID, partsMetadata[i], bucket, object); err != nil {
logger.LogIf(ctx, err)
return result, err return result, err
} }
@ -905,7 +902,6 @@ func (er *erasureObjects) healObjectDir(ctx context.Context, bucket, object stri
case errDiskNotFound: case errDiskNotFound:
hr.After.Drives[i].State = madmin.DriveStateOffline hr.After.Drives[i].State = madmin.DriveStateOffline
default: default:
logger.LogIf(ctx, merr)
hr.After.Drives[i].State = madmin.DriveStateCorrupt hr.After.Drives[i].State = madmin.DriveStateCorrupt
} }
} }