Use readQuorum instead of writeQuorum to check bucket exists (#5715)

Fixes #5708
Fixes #5700
master
Harshavardhana 7 years ago committed by Dee Koder
parent 19451e374a
commit de44be86d0
  1. 6
      cmd/admin-heal-ops.go
  2. 2
      cmd/xl-sets.go
  3. 4
      cmd/xl-v1-healing.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.")

@ -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)
}

@ -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

Loading…
Cancel
Save