Ignore file not found error for multipart-uploads (#5065)

Dont print the error errFileNotFound, as it is expected that concurrent
complete-multipart-uploads or abort-multipart-uploads would have deleted
the file, and the file may not be found

Fixes: https://github.com/minio/minio/issues/5056
This commit is contained in:
Nitish Tiwari
2017-10-19 02:56:20 +05:30
committed by Dee Koder
parent f25bec6bf1
commit 8287ab091c
2 changed files with 80 additions and 2 deletions

View File

@@ -744,7 +744,13 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload
if removeObjectDir {
basePath := pathJoin(fs.fsPath, minioMetaMultipartBucket, bucket)
derr := fsDeleteFile(basePath, pathJoin(basePath, object))
errorIf(derr, "unable to remove %s in %s", pathJoin(basePath, object), basePath)
if derr = errorCause(derr); derr != nil {
// In parallel execution, CompleteMultipartUpload could have deleted temporary
// state files/directory, it is safe to ignore errFileNotFound
if derr != errFileNotFound {
errorIf(derr, "unable to remove %s in %s", pathJoin(basePath, object), basePath)
}
}
}
objectMPartPathLock.Unlock()
}()
@@ -979,7 +985,13 @@ func (fs fsObjects) AbortMultipartUpload(bucket, object, uploadID string) error
if removeObjectDir {
basePath := pathJoin(fs.fsPath, minioMetaMultipartBucket, bucket)
derr := fsDeleteFile(basePath, pathJoin(basePath, object))
errorIf(derr, "unable to remove %s in %s", pathJoin(basePath, object), basePath)
if derr = errorCause(derr); derr != nil {
// In parallel execution, AbortMultipartUpload could have deleted temporary
// state files/directory, it is safe to ignore errFileNotFound
if derr != errFileNotFound {
errorIf(derr, "unable to remove %s in %s", pathJoin(basePath, object), basePath)
}
}
}
objectMPartPathLock.Unlock()
}()