mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
Fix readiness to return 200 for read-only mode (#8728)
- We should declare a cluster ready even if read quorum is achieved (atleast n/2 disks are online). - Such that, all the zones should have enough read quorum. Thus making the cluster ready for reads.
This commit is contained in:
committed by
kannappanr
parent
97d799b9f0
commit
157721f694
@@ -1657,7 +1657,7 @@ func (s *xlSets) GetMetrics(ctx context.Context) (*Metrics, error) {
|
||||
return &Metrics{}, NotImplemented{}
|
||||
}
|
||||
|
||||
// IsReady - Returns true if more than n/2 disks (quorum) are online
|
||||
// IsReady - Returns true if atleast n/2 disks (read quorum) are online
|
||||
func (s *xlSets) IsReady(_ context.Context) bool {
|
||||
s.xlDisksMu.RLock()
|
||||
defer s.xlDisksMu.RUnlock()
|
||||
@@ -1674,8 +1674,8 @@ func (s *xlSets) IsReady(_ context.Context) bool {
|
||||
if s.xlDisks[i][j].IsOnline() {
|
||||
activeDisks++
|
||||
}
|
||||
// Return if more than n/2 disks are online.
|
||||
if activeDisks > len(s.endpoints)/2 {
|
||||
// Return true if read quorum is available.
|
||||
if activeDisks >= len(s.endpoints)/2 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user