From 8491a29ec3f179577bda5b1f8ee02bc335ce001e Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 28 Oct 2018 14:13:17 -0700 Subject: [PATCH] Fix healing bucket properly (#6716) Bucket should be healed properly if it partially exists on only one set, since bucket is common for all sets. Fixes #6710 --- cmd/xl-v1-healing.go | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/cmd/xl-v1-healing.go b/cmd/xl-v1-healing.go index e6049fe3a..245672417 100644 --- a/cmd/xl-v1-healing.go +++ b/cmd/xl-v1-healing.go @@ -36,29 +36,6 @@ func (xl xlObjects) HealFormat(ctx context.Context, dryRun bool) (madmin.HealRes return madmin.HealResultItem{}, NotImplemented{} } -// checks for bucket if it exists in writeQuorum number of disks, this call -// is only used by healBucket(). -func checkBucketExistsInQuorum(ctx context.Context, storageDisks []StorageAPI, bucketName string) (err error) { - var wg = &sync.WaitGroup{} - - errs := make([]error, len(storageDisks)) - // Prepare object creation in a all disks - for index, disk := range storageDisks { - if disk == nil { - continue - } - wg.Add(1) - go func(index int, disk StorageAPI) { - defer wg.Done() - _, errs[index] = disk.StatVol(bucketName) - }(index, disk) - } - wg.Wait() - - readQuorum := len(storageDisks) / 2 - return reduceWriteQuorumErrs(ctx, errs, nil, readQuorum) -} - // Heals a bucket if it doesn't exist on one of the disks, additionally // also heals the missing entries for bucket metadata files // `policy.json, notification.xml, listeners.json`. @@ -67,13 +44,6 @@ func (xl xlObjects) HealBucket(ctx context.Context, bucket string, dryRun bool) storageDisks := xl.getDisks() - // Check if bucket doesn't exist in writeQuorum number of disks, if quorum - // number of disks returned that bucket does not exist we quickly return - // and do not proceed to heal. - if err = checkBucketExistsInQuorum(ctx, storageDisks, bucket); err != nil { - return results, err - } - // get write quorum for an object writeQuorum := len(storageDisks)/2 + 1