mirror of
https://github.com/minio/minio.git
synced 2025-01-27 06:33:18 -05:00
Use readQuorum instead of writeQuorum to check bucket exists (#5715)
Fixes #5708 Fixes #5700
This commit is contained in:
parent
19451e374a
commit
de44be86d0
@ -217,9 +217,9 @@ func (ahs *allHealState) LaunchNewHealSequence(h *healSequence) (
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
b, err := json.Marshal(madmin.HealStartSuccess{
|
b, err := json.Marshal(madmin.HealStartSuccess{
|
||||||
h.clientToken,
|
ClientToken: h.clientToken,
|
||||||
h.clientAddress,
|
ClientAddress: h.clientAddress,
|
||||||
h.startTime,
|
StartTime: h.startTime,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorIf(err, "Failed to marshal heal result into json.")
|
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.
|
// Check if we had quorum to write, if not return an appropriate error.
|
||||||
_, afterDriveOnline := res.GetOnlineCounts()
|
_, afterDriveOnline := res.GetOnlineCounts()
|
||||||
if afterDriveOnline < s.setCount*s.drivesPerSet/2+1 {
|
if afterDriveOnline < ((s.setCount*s.drivesPerSet)/2)+1 {
|
||||||
return nil, toObjectErr(errXLWriteQuorum, bucket)
|
return nil, toObjectErr(errXLWriteQuorum, bucket)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ func checkBucketExistsInQuorum(storageDisks []StorageAPI, bucketName string) (er
|
|||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
writeQuorum := len(storageDisks)/2 + 1
|
readQuorum := len(storageDisks) / 2
|
||||||
return reduceWriteQuorumErrs(errs, nil, writeQuorum)
|
return reduceWriteQuorumErrs(errs, nil, readQuorum)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Heals a bucket if it doesn't exist on one of the disks, additionally
|
// Heals a bucket if it doesn't exist on one of the disks, additionally
|
||||||
|
Loading…
x
Reference in New Issue
Block a user