From 3ff0a56e6220d9335c045cc272893ae81fb571e1 Mon Sep 17 00:00:00 2001 From: Bala FA Date: Thu, 12 May 2016 12:12:14 +0530 Subject: [PATCH] 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 --- object-common-multipart.go | 4 ++-- xl-erasure-v1-common.go | 4 ++-- xl-erasure-v1.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/object-common-multipart.go b/object-common-multipart.go index 260fa4d3c..33acfb7c5 100644 --- a/object-common-multipart.go +++ b/object-common-multipart.go @@ -312,8 +312,8 @@ func listMetaBucketMultipartFiles(layer ObjectLayer, prefixPath string, markerPa "marker": markerPath, "recursive": recursive, }).Debugf("Walk resulted in an error %s", walkResult.err) - // File not found is a valid case. - if walkResult.err == errFileNotFound { + // 'File not found' or 'Disk not found' is a valid case. + if walkResult.err == errFileNotFound || walkResult.err == errDiskNotFound { return nil, true, nil } return nil, false, toObjectErr(walkResult.err, minioMetaBucket, prefixPath) diff --git a/xl-erasure-v1-common.go b/xl-erasure-v1-common.go index dfa76b737..08df66dd0 100644 --- a/xl-erasure-v1-common.go +++ b/xl-erasure-v1-common.go @@ -58,9 +58,9 @@ func (xl XL) listOnlineDisks(volume, path string) (onlineDisks []StorageAPI, mda notFoundCount := 0 diskNotFoundCount := 0 for _, err := range errs { - if err == errFileNotFound { + if err == errFileNotFound || err == errDiskNotFound { 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. if notFoundCount > len(xl.storageDisks)-xl.readQuorum { return nil, xlMetaV1{}, false, errFileNotFound diff --git a/xl-erasure-v1.go b/xl-erasure-v1.go index ca0a436a4..56d8544ce 100644 --- a/xl-erasure-v1.go +++ b/xl-erasure-v1.go @@ -243,8 +243,8 @@ func (xl XL) DeleteVol(volume string) error { log.WithFields(logrus.Fields{ "volume": volume, }).Errorf("DeleteVol failed with %s", err) - // We ignore error if errVolumeNotFound. - if err == errVolumeNotFound { + // We ignore error if errVolumeNotFound or errDiskNotFound + if err == errVolumeNotFound || err == errDiskNotFound { volumeNotFoundErrCnt++ continue }