mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 08:13:28 +03:00
XL: listOnlineDisks should use modTime instead of version. (#2166)
This change is needed to make reading from objects future proof in-terms of handling online disks. Our current counter is not based on affirmative knowledge and relies on arithmetic sequence which can lead to bugs. Using modTime simplifies the understanding of `xl.json` and future tooling / debugging of the format.
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
e5cd35aad0
commit
623e0f9243
+4
-4
@@ -78,14 +78,14 @@ func reduceErrs(errs []error) error {
|
||||
|
||||
// Validates if we have quorum based on the errors with errDiskNotFound.
|
||||
func isQuorum(errs []error, minQuorumCount int) bool {
|
||||
var diskFoundCount int
|
||||
var errCount int
|
||||
for _, err := range errs {
|
||||
if err == errDiskNotFound {
|
||||
if err == errDiskNotFound || err == errFaultyDisk || err == errDiskAccessDenied {
|
||||
continue
|
||||
}
|
||||
diskFoundCount++
|
||||
errCount++
|
||||
}
|
||||
return diskFoundCount >= minQuorumCount
|
||||
return errCount >= minQuorumCount
|
||||
}
|
||||
|
||||
// Similar to 'len(slice)' but returns the actual elements count
|
||||
|
||||
Reference in New Issue
Block a user