mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 16:23:28 +03:00
XL: isQuorum rename as isDiskQuorum, word it properly. (#2196)
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
3b69b4ada4
commit
dc3bafb194
+8
-6
@@ -76,16 +76,18 @@ func reduceErrs(errs []error) error {
|
||||
return errTypes[max].err
|
||||
}
|
||||
|
||||
// Validates if we have quorum based on the errors with errDiskNotFound.
|
||||
func isQuorum(errs []error, minQuorumCount int) bool {
|
||||
var errCount int
|
||||
// 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
|
||||
for _, err := range errs {
|
||||
if err == errDiskNotFound || err == errFaultyDisk || err == errDiskAccessDenied {
|
||||
switch err {
|
||||
case errDiskNotFound, errFaultyDisk, errDiskAccessDenied:
|
||||
continue
|
||||
}
|
||||
errCount++
|
||||
count++
|
||||
}
|
||||
return errCount >= minQuorumCount
|
||||
return count >= minQuorumCount
|
||||
}
|
||||
|
||||
// Similar to 'len(slice)' but returns the actual elements count
|
||||
|
||||
Reference in New Issue
Block a user