mirror of
https://github.com/minio/minio.git
synced 2025-11-20 09:56:07 -05:00
auth/rpc: Take remote disk offline after maximum allowed attempts. (#3288)
Disks when are offline for a long period of time, we should ignore the disk after trying Login upto 5 times. This is to reduce the network chattiness, this also reduces the overall time spent on `net.Dial`. Fixes #3286
This commit is contained in:
@@ -52,19 +52,25 @@ func reduceErrs(errs []error, ignoredErrs []error) error {
|
||||
return traceError(errMax, errs...)
|
||||
}
|
||||
|
||||
// List of all errors which are ignored while verifying quorum.
|
||||
var quorumIgnoredErrs = []error{
|
||||
errFaultyDisk,
|
||||
errFaultyRemoteDisk,
|
||||
errDiskNotFound,
|
||||
errDiskAccessDenied,
|
||||
}
|
||||
|
||||
// Validates if we have quorum based on the errors related to disk only.
|
||||
// Returns 'true' if we have quorum, 'false' if we don't.
|
||||
func isDiskQuorum(errs []error, minQuorumCount int) bool {
|
||||
var count int
|
||||
errs = errorsCause(errs)
|
||||
for _, err := range errs {
|
||||
switch err {
|
||||
case errDiskNotFound, errFaultyDisk, errDiskAccessDenied:
|
||||
continue
|
||||
// Check if the error can be ignored for quorum verification.
|
||||
if !isErrIgnored(err, quorumIgnoredErrs) {
|
||||
count++
|
||||
}
|
||||
count++
|
||||
}
|
||||
|
||||
return count >= minQuorumCount
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user