mirror of
https://github.com/minio/minio.git
synced 2025-02-03 01:46:00 -05:00
erasure: listOnlineDisks should return errFileNotFound for errReadQuorum. (#1573)
Fixes #1571
This commit is contained in:
parent
0db3218d5d
commit
5f0ca64346
@ -63,12 +63,13 @@ func (xl XL) listOnlineDisks(volume, path string) (onlineDisks []StorageAPI, mda
|
|||||||
for _, err := range errs {
|
for _, err := range errs {
|
||||||
if err == errFileNotFound {
|
if err == errFileNotFound {
|
||||||
notFoundCount++
|
notFoundCount++
|
||||||
|
// If we have errors with file not found equal to the number of disks.
|
||||||
|
if notFoundCount > len(xl.storageDisks)-xl.readQuorum {
|
||||||
|
return nil, xlMetaV1{}, false, errFileNotFound
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If we have errors with file not found equal to the number of disks.
|
|
||||||
if notFoundCount == len(xl.storageDisks) {
|
|
||||||
return nil, xlMetaV1{}, false, errFileNotFound
|
|
||||||
}
|
|
||||||
highestVersion := int64(0)
|
highestVersion := int64(0)
|
||||||
onlineDisks = make([]StorageAPI, len(xl.storageDisks))
|
onlineDisks = make([]StorageAPI, len(xl.storageDisks))
|
||||||
// List all the file versions from partsMetadata list.
|
// List all the file versions from partsMetadata list.
|
||||||
|
@ -191,11 +191,14 @@ func getMultipartObjectInfo(storage StorageAPI, bucket, object string) (info Mul
|
|||||||
offset := int64(0)
|
offset := int64(0)
|
||||||
r, err := storage.ReadFile(bucket, pathJoin(object, multipartMetaFile), offset)
|
r, err := storage.ReadFile(bucket, pathJoin(object, multipartMetaFile), offset)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return MultipartObjectInfo{}, err
|
||||||
}
|
}
|
||||||
decoder := json.NewDecoder(r)
|
decoder := json.NewDecoder(r)
|
||||||
err = decoder.Decode(&info)
|
err = decoder.Decode(&info)
|
||||||
return
|
if err != nil {
|
||||||
|
return MultipartObjectInfo{}, err
|
||||||
|
}
|
||||||
|
return info, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetObjectInfo - get object info.
|
// GetObjectInfo - get object info.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user