From de44be86d03df027f60b7f9d35230f195968e309 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 26 Mar 2018 16:36:57 -0700 Subject: [PATCH] Use readQuorum instead of writeQuorum to check bucket exists (#5715) Fixes #5708 Fixes #5700 --- cmd/admin-heal-ops.go | 6 +++--- cmd/xl-sets.go | 2 +- cmd/xl-v1-healing.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/admin-heal-ops.go b/cmd/admin-heal-ops.go index 47541302d..b67a199ac 100644 --- a/cmd/admin-heal-ops.go +++ b/cmd/admin-heal-ops.go @@ -217,9 +217,9 @@ func (ahs *allHealState) LaunchNewHealSequence(h *healSequence) ( }() b, err := json.Marshal(madmin.HealStartSuccess{ - h.clientToken, - h.clientAddress, - h.startTime, + ClientToken: h.clientToken, + ClientAddress: h.clientAddress, + StartTime: h.startTime, }) if err != nil { errorIf(err, "Failed to marshal heal result into json.") diff --git a/cmd/xl-sets.go b/cmd/xl-sets.go index e7eea881f..78c9ab69e 100644 --- a/cmd/xl-sets.go +++ b/cmd/xl-sets.go @@ -1105,7 +1105,7 @@ func (s *xlSets) HealBucket(ctx context.Context, bucket string, dryRun bool) (re // Check if we had quorum to write, if not return an appropriate error. _, afterDriveOnline := res.GetOnlineCounts() - if afterDriveOnline < s.setCount*s.drivesPerSet/2+1 { + if afterDriveOnline < ((s.setCount*s.drivesPerSet)/2)+1 { return nil, toObjectErr(errXLWriteQuorum, bucket) } diff --git a/cmd/xl-v1-healing.go b/cmd/xl-v1-healing.go index 07e2f7fb1..517124e3b 100644 --- a/cmd/xl-v1-healing.go +++ b/cmd/xl-v1-healing.go @@ -49,8 +49,8 @@ func checkBucketExistsInQuorum(storageDisks []StorageAPI, bucketName string) (er } wg.Wait() - writeQuorum := len(storageDisks)/2 + 1 - return reduceWriteQuorumErrs(errs, nil, writeQuorum) + readQuorum := len(storageDisks) / 2 + return reduceWriteQuorumErrs(errs, nil, readQuorum) } // Heals a bucket if it doesn't exist on one of the disks, additionally