mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
remove short circuited healing optimization (#12796)
this healing optimization caused multiple regressions in healing - delete-markers incorrectly missing heal and returning incorrect healing results to client. - missing individual 'parts' such as for restored object or simply for all objects just missing few parts. This optimization is not necessary, we should proceed to verify all cases possible not just when metadata is inconsistent.
This commit is contained in:
@@ -907,7 +907,7 @@ func (er erasureObjects) HealObject(ctx context.Context, bucket, object, version
|
||||
|
||||
// Perform quick read without lock.
|
||||
// This allows to quickly check if all is ok or all are missing.
|
||||
partsMetadata, errs := readAllFileInfo(healCtx, storageDisks, bucket, object, versionID, false)
|
||||
_, errs := readAllFileInfo(healCtx, storageDisks, bucket, object, versionID, false)
|
||||
if isAllNotFound(errs) {
|
||||
err = toObjectErr(errFileNotFound, bucket, object)
|
||||
if versionID != "" {
|
||||
@@ -918,15 +918,6 @@ func (er erasureObjects) HealObject(ctx context.Context, bucket, object, version
|
||||
errs, bucket, object, versionID), err
|
||||
}
|
||||
|
||||
// Return early if all ok and not deep scanning.
|
||||
if opts.ScanMode == madmin.HealNormalScan && fileInfoConsistent(ctx, partsMetadata, errs) {
|
||||
fi, err := getLatestFileInfo(ctx, partsMetadata, errs)
|
||||
if err == nil && fi.VersionID == versionID {
|
||||
return er.defaultHealResult(fi, storageDisks, storageEndpoints,
|
||||
errs, bucket, object, versionID), nil
|
||||
}
|
||||
}
|
||||
|
||||
// Heal the object.
|
||||
return er.healObject(healCtx, bucket, object, versionID, opts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user