mirror of
https://github.com/pgsty/minio.git
synced 2026-08-11 00:33:28 +03:00
XL: Refactor usage of reduceErrs and consistent behavior. (#2240)
This refactor is also needed in lieu of our quorum requirement change for the newly understood logic behind klauspost/reedsolom implementation.
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
f67c930731
commit
cef26fd6ea
+5
-2
@@ -30,9 +30,12 @@ import (
|
||||
// value is greater than or equal to simple majority, since none of the equally
|
||||
// maximal values would occur quorum or more number of times.
|
||||
|
||||
func reduceErrs(errs []error) (int, error) {
|
||||
func reduceErrs(errs []error, ignoredErrs []error) error {
|
||||
errorCounts := make(map[error]int)
|
||||
for _, err := range errs {
|
||||
if isErrIgnored(err, ignoredErrs) {
|
||||
continue
|
||||
}
|
||||
errorCounts[err]++
|
||||
}
|
||||
max := 0
|
||||
@@ -43,7 +46,7 @@ func reduceErrs(errs []error) (int, error) {
|
||||
errMax = err
|
||||
}
|
||||
}
|
||||
return max, errMax
|
||||
return errMax
|
||||
}
|
||||
|
||||
// Validates if we have quorum based on the errors related to disk only.
|
||||
|
||||
Reference in New Issue
Block a user