mirror of
https://github.com/minio/minio.git
synced 2025-04-01 10:13:42 -04:00
fix: healBucket across sets should capture results properly (#11341)
healing `.minio.sys/config` returns incorrect quorum errors across sets, healing of the buckets.
This commit is contained in:
parent
82f0471d1b
commit
09bc49bd51
@ -102,16 +102,13 @@ func healBucket(ctx context.Context, storageDisks []StorageAPI, storageEndpoints
|
|||||||
|
|
||||||
errs := g.Wait()
|
errs := g.Wait()
|
||||||
|
|
||||||
reducedErr := reduceWriteQuorumErrs(ctx, errs, bucketOpIgnoredErrs, writeQuorum-1)
|
|
||||||
if errors.Is(reducedErr, errVolumeNotFound) && !opts.Recreate {
|
|
||||||
return res, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize heal result info
|
// Initialize heal result info
|
||||||
res = madmin.HealResultItem{
|
res = madmin.HealResultItem{
|
||||||
Type: madmin.HealItemBucket,
|
Type: madmin.HealItemBucket,
|
||||||
Bucket: bucket,
|
Bucket: bucket,
|
||||||
DiskCount: len(storageDisks),
|
DiskCount: len(storageDisks),
|
||||||
|
ParityBlocks: len(storageDisks) / 2,
|
||||||
|
DataBlocks: len(storageDisks) / 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := range beforeState {
|
for i := range beforeState {
|
||||||
@ -122,6 +119,18 @@ func healBucket(ctx context.Context, storageDisks []StorageAPI, storageEndpoints
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reducedErr := reduceWriteQuorumErrs(ctx, errs, bucketOpIgnoredErrs, writeQuorum-1)
|
||||||
|
if errors.Is(reducedErr, errVolumeNotFound) && !opts.Recreate {
|
||||||
|
for i := range beforeState {
|
||||||
|
res.After.Drives = append(res.After.Drives, madmin.HealDriveInfo{
|
||||||
|
UUID: "",
|
||||||
|
Endpoint: storageEndpoints[i],
|
||||||
|
State: madmin.DriveStateOk,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize sync waitgroup.
|
// Initialize sync waitgroup.
|
||||||
g = errgroup.WithNErrs(len(storageDisks))
|
g = errgroup.WithNErrs(len(storageDisks))
|
||||||
|
|
||||||
|
@ -128,7 +128,12 @@ func readAllFileInfo(ctx context.Context, disks []StorageAPI, bucket, object, ve
|
|||||||
}
|
}
|
||||||
metadataArray[index], err = disks[index].ReadVersion(ctx, bucket, object, versionID, readData)
|
metadataArray[index], err = disks[index].ReadVersion(ctx, bucket, object, versionID, readData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !IsErr(err, errFileNotFound, errVolumeNotFound, errFileVersionNotFound, errDiskNotFound) {
|
if !IsErr(err, []error{
|
||||||
|
errFileNotFound,
|
||||||
|
errVolumeNotFound,
|
||||||
|
errFileVersionNotFound,
|
||||||
|
errDiskNotFound,
|
||||||
|
}...) {
|
||||||
logger.LogOnceIf(ctx, err, disks[index].String())
|
logger.LogOnceIf(ctx, err, disks[index].String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user