mirror of
https://github.com/minio/minio
synced 2024-11-05 17:34:01 +00:00
Handle uptime for single-node instances differnt from distributed setup (#3726)
This commit is contained in:
parent
1b4bb94ac4
commit
1ad96ee09f
1 changed files with 10 additions and 2 deletions
|
@ -287,6 +287,13 @@ func (ts uptimeSlice) Swap(i, j int) {
|
|||
// getPeerUptimes - returns the uptime since the last time read quorum
|
||||
// was established on success. Otherwise returns errXLReadQuorum.
|
||||
func getPeerUptimes(peers adminPeers) (time.Duration, error) {
|
||||
// In a single node Erasure or FS backend setup the uptime of
|
||||
// the setup is the uptime of the single minio server
|
||||
// instance.
|
||||
if !globalIsDistXL {
|
||||
return time.Now().UTC().Sub(globalBootTime), nil
|
||||
}
|
||||
|
||||
uptimes := make(uptimeSlice, len(peers))
|
||||
|
||||
// Get up time of all servers.
|
||||
|
@ -320,8 +327,9 @@ func getPeerUptimes(peers adminPeers) (time.Duration, error) {
|
|||
}
|
||||
}
|
||||
|
||||
// This implies there weren't read quorum number of servers up.
|
||||
if latestUptime == time.Duration(0) {
|
||||
// Less than readQuorum "Admin.Uptime" RPC call returned
|
||||
// successfully, so read-quorum unavailable.
|
||||
if validCount < readQuorum {
|
||||
return time.Duration(0), InsufficientReadQuorum{}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue