heal: Heal bucket metadata when a fresh disk is inserted (#11734)

Replacing disk with a fresh one never heals bucket metadata (policy,
notification, etc..). This commit fixes the issue.
This commit is contained in:
Anis Elleuch 2021-03-08 19:54:13 +01:00 committed by GitHub
parent 78e867e145
commit 64662a49ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -375,6 +375,12 @@ func monitorLocalDisksAndHeal(ctx context.Context, z *erasureServerPools, bgSeq
Name: pathJoin(minioMetaBucket, minioConfigPrefix),
})
// Buckets data are dispersed in multiple zones/sets, make
// sure to heal all bucket metadata configuration.
buckets = append(buckets, []BucketInfo{
{Name: pathJoin(minioMetaBucket, bucketMetaPrefix)},
}...)
// Heal latest buckets first.
sort.Slice(buckets, func(i, j int) bool {
a, b := strings.HasPrefix(buckets[i].Name, minioMetaBucket), strings.HasPrefix(buckets[j].Name, minioMetaBucket)