From 22511dc4c7c3ba53aee0a821da03a0939c31468a Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Wed, 1 Jun 2016 00:23:28 +0530 Subject: [PATCH] XL/Multipart: During list-multipart-uploads ignore errFileNotFound and errDiskNotFound errors. (#1813) Fixes #1795 --- xl-v1-multipart-common.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xl-v1-multipart-common.go b/xl-v1-multipart-common.go index 740ed9ddd..b5b8cb374 100644 --- a/xl-v1-multipart-common.go +++ b/xl-v1-multipart-common.go @@ -401,7 +401,10 @@ func (xl xlObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark var err error var eof bool if uploadIDMarker != "" { + nsMutex.RLock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, keyMarker)) uploads, _, err = listMultipartUploadIDs(bucket, keyMarker, uploadIDMarker, maxUploads, xl.getRandomDisk()) + nsMutex.RUnlock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, keyMarker)) + if err != nil { return ListMultipartsInfo{}, err } @@ -423,8 +426,7 @@ func (xl xlObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark if walkResult.err != nil { // File not found or Disk not found is a valid case. if walkResult.err == errFileNotFound || walkResult.err == errDiskNotFound { - eof = true - break + continue } return ListMultipartsInfo{}, err } @@ -445,8 +447,13 @@ func (xl xlObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark var newUploads []uploadMetadata var end bool uploadIDMarker = "" + nsMutex.RLock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, entry)) newUploads, end, err = listMultipartUploadIDs(bucket, entry, uploadIDMarker, maxUploads, xl.getRandomDisk()) + nsMutex.RUnlock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, entry)) if err != nil { + if err == errFileNotFound || walkResult.err == errDiskNotFound { + continue + } return ListMultipartsInfo{}, err } uploads = append(uploads, newUploads...)