fix: heal rejects objects with disk re-ordering issue (#10766)

This commit is contained in:
Krishna Srinivas 2020-10-26 18:48:47 -07:00 committed by GitHub
parent c49a80db41
commit 592f2f23a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,6 +221,17 @@ func (er erasureObjects) healObject(ctx context.Context, bucket string, object s
partsMetadata []FileInfo, errs []error, latestFileInfo FileInfo,
dryRun bool, remove bool, scanMode madmin.HealScanMode) (result madmin.HealResultItem, err error) {
for i, metadata := range shufflePartsMetadata(partsMetadata, latestFileInfo.Erasure.Distribution) {
if !metadata.IsValid() {
continue
}
if i != metadata.Erasure.Index-1 {
// FIXME: fix in the next release for objects which erasure.Index does not match
// with expected distribution.
return result, fmt.Errorf("Unable to heal object %s, disk ordering issue detected", pathJoin(bucket, object))
}
}
dataBlocks := latestFileInfo.Erasure.DataBlocks
storageDisks := er.getDisks()