mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
fix: strict quorum in list should list on all drives (#11157)
current implementation was incorrect, it in-fact assumed only read quorum number of disks. in-fact that value is only meant for read quorum good entries from all online disks. This PR fixes this behavior properly.
This commit is contained in:
parent
5982965839
commit
6a66f142d4
@ -113,8 +113,6 @@ func (sCfg *Config) UnmarshalJSON(data []byte) error {
|
||||
// acceptable quorum expected for list operations
|
||||
func (sCfg Config) GetListQuorum() int {
|
||||
switch sCfg.ListQuorum {
|
||||
case "optimal":
|
||||
return 3
|
||||
case "reduced":
|
||||
return 2
|
||||
case "disk":
|
||||
@ -123,7 +121,7 @@ func (sCfg Config) GetListQuorum() int {
|
||||
case "strict":
|
||||
return -1
|
||||
}
|
||||
// Defaults to 3 drives per set.
|
||||
// Defaults to 3 drives per set, defaults to "optimal" value
|
||||
return 3
|
||||
}
|
||||
|
||||
|
@ -595,16 +595,11 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr
|
||||
}()
|
||||
|
||||
askDisks := o.AskDisks
|
||||
if askDisks == -1 {
|
||||
askDisks = getReadQuorum(er.SetDriveCount())
|
||||
}
|
||||
|
||||
listingQuorum := askDisks - 1
|
||||
|
||||
// Special case: ask all disks if the drive count is 4
|
||||
if er.SetDriveCount() == 4 {
|
||||
askDisks = len(disks)
|
||||
listingQuorum = 2
|
||||
if askDisks == -1 || er.SetDriveCount() == 4 {
|
||||
askDisks = len(disks) // with 'strict' quorum list on all online disks.
|
||||
listingQuorum = getReadQuorum(er.SetDriveCount())
|
||||
}
|
||||
|
||||
if len(disks) < askDisks {
|
||||
|
Loading…
Reference in New Issue
Block a user