odd stripe sizes should choose (odd+1)/2 to get correct quorum (#14610)

This commit is contained in:
Harshavardhana 2022-03-22 12:21:14 -07:00 committed by GitHub
parent 50577e2bd2
commit 8eecdc6d1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -547,8 +547,8 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions, resul
// Special case: ask all disks if the drive count is 4
if askDisks <= 0 || er.setDriveCount == 4 {
askDisks = len(disks) // with 'strict' quorum list on all online disks.
listingQuorum = len(disks) / 2 // keep this such that we can list all objects with different quorum ratio.
askDisks = len(disks) // with 'strict' quorum list on all online disks.
listingQuorum = (len(disks) + 1) / 2 // keep this such that we can list all objects with different quorum ratio.
}
if askDisks > 0 && len(disks) > askDisks {
rand.Shuffle(len(disks), func(i, j int) {