mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
[feature] allow for an odd number of erasure packs (#9221)
Too many deployments come up with an odd number of hosts or drives, to facilitate even distribution among those setups allow for odd and prime numbers based packs.
This commit is contained in:
@@ -20,7 +20,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
golog "log"
|
||||
"math"
|
||||
"math/rand"
|
||||
"os"
|
||||
"sync"
|
||||
@@ -237,8 +236,8 @@ func lock(ds *Dsync, locks *[]string, id, source string, isReadLock bool, lockNa
|
||||
done := false
|
||||
timeout := time.After(DRWMutexAcquireTimeout)
|
||||
|
||||
dquorum := int(len(restClnts)/2) + 1
|
||||
dquorumReads := int(math.Ceil(float64(len(restClnts)) / 2.0))
|
||||
dquorumReads := (len(restClnts) + 1) / 2
|
||||
dquorum := dquorumReads + 1
|
||||
|
||||
for ; i < len(restClnts); i++ { // Loop until we acquired all locks
|
||||
|
||||
|
||||
Reference in New Issue
Block a user