mirror of
https://github.com/minio/minio.git
synced 2025-01-23 20:53:18 -05:00
XL: Ignore errDiskNotFound in certain situations (#1610)
When a disk is removed while an operation is going on (eg. single/multipart put object, list/multipart list objects etc), its required to ignore errDiskNotFound error and continue the operation. Fixes #1552
This commit is contained in:
parent
50431e91a6
commit
3ff0a56e62
@ -312,8 +312,8 @@ func listMetaBucketMultipartFiles(layer ObjectLayer, prefixPath string, markerPa
|
|||||||
"marker": markerPath,
|
"marker": markerPath,
|
||||||
"recursive": recursive,
|
"recursive": recursive,
|
||||||
}).Debugf("Walk resulted in an error %s", walkResult.err)
|
}).Debugf("Walk resulted in an error %s", walkResult.err)
|
||||||
// File not found is a valid case.
|
// 'File not found' or 'Disk not found' is a valid case.
|
||||||
if walkResult.err == errFileNotFound {
|
if walkResult.err == errFileNotFound || walkResult.err == errDiskNotFound {
|
||||||
return nil, true, nil
|
return nil, true, nil
|
||||||
}
|
}
|
||||||
return nil, false, toObjectErr(walkResult.err, minioMetaBucket, prefixPath)
|
return nil, false, toObjectErr(walkResult.err, minioMetaBucket, prefixPath)
|
||||||
|
@ -58,9 +58,9 @@ func (xl XL) listOnlineDisks(volume, path string) (onlineDisks []StorageAPI, mda
|
|||||||
notFoundCount := 0
|
notFoundCount := 0
|
||||||
diskNotFoundCount := 0
|
diskNotFoundCount := 0
|
||||||
for _, err := range errs {
|
for _, err := range errs {
|
||||||
if err == errFileNotFound {
|
if err == errFileNotFound || err == errDiskNotFound {
|
||||||
notFoundCount++
|
notFoundCount++
|
||||||
// If we have errors with file not found greater than
|
// If we have errors with 'file not found' or 'disk not found' greater than
|
||||||
// writeQuroum, return as errFileNotFound.
|
// writeQuroum, return as errFileNotFound.
|
||||||
if notFoundCount > len(xl.storageDisks)-xl.readQuorum {
|
if notFoundCount > len(xl.storageDisks)-xl.readQuorum {
|
||||||
return nil, xlMetaV1{}, false, errFileNotFound
|
return nil, xlMetaV1{}, false, errFileNotFound
|
||||||
|
@ -243,8 +243,8 @@ func (xl XL) DeleteVol(volume string) error {
|
|||||||
log.WithFields(logrus.Fields{
|
log.WithFields(logrus.Fields{
|
||||||
"volume": volume,
|
"volume": volume,
|
||||||
}).Errorf("DeleteVol failed with %s", err)
|
}).Errorf("DeleteVol failed with %s", err)
|
||||||
// We ignore error if errVolumeNotFound.
|
// We ignore error if errVolumeNotFound or errDiskNotFound
|
||||||
if err == errVolumeNotFound {
|
if err == errVolumeNotFound || err == errDiskNotFound {
|
||||||
volumeNotFoundErrCnt++
|
volumeNotFoundErrCnt++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user