mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Fix tracing twice an error in fs Complete Multipart Upload (#2703)
This commit is contained in:
parent
e273a40345
commit
6f73d597e0
@ -644,14 +644,14 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload
|
|||||||
// Calculate s3 compatible md5sum for complete multipart.
|
// Calculate s3 compatible md5sum for complete multipart.
|
||||||
s3MD5, err := completeMultipartMD5(parts...)
|
s3MD5, err := completeMultipartMD5(parts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", traceError(err)
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read saved fs metadata for ongoing multipart.
|
// Read saved fs metadata for ongoing multipart.
|
||||||
fsMetaPath := pathJoin(uploadIDPath, fsMetaJSONFile)
|
fsMetaPath := pathJoin(uploadIDPath, fsMetaJSONFile)
|
||||||
fsMeta, err := readFSMetadata(fs.storage, minioMetaBucket, fsMetaPath)
|
fsMeta, err := readFSMetadata(fs.storage, minioMetaBucket, fsMetaPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", toObjectErr(traceError(err), minioMetaBucket, fsMetaPath)
|
return "", toObjectErr(err, minioMetaBucket, fsMetaPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
fsAppendMeta, err := readFSMetadata(fs.storage, minioMetaBucket, fsAppendMetaPath)
|
fsAppendMeta, err := readFSMetadata(fs.storage, minioMetaBucket, fsAppendMetaPath)
|
||||||
@ -745,7 +745,7 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload
|
|||||||
|
|
||||||
// Cleanup all the parts if everything else has been safely committed.
|
// Cleanup all the parts if everything else has been safely committed.
|
||||||
if err = cleanupUploadedParts(bucket, object, uploadID, fs.storage); err != nil {
|
if err = cleanupUploadedParts(bucket, object, uploadID, fs.storage); err != nil {
|
||||||
return "", toObjectErr(traceError(err), bucket, object)
|
return "", toObjectErr(err, bucket, object)
|
||||||
}
|
}
|
||||||
|
|
||||||
// generates random string on setting MINIO_DEBUG=lock, else returns empty string.
|
// generates random string on setting MINIO_DEBUG=lock, else returns empty string.
|
||||||
@ -761,7 +761,7 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload
|
|||||||
// the object, if yes do not attempt to delete 'uploads.json'.
|
// the object, if yes do not attempt to delete 'uploads.json'.
|
||||||
uploadsJSON, err := readUploadsJSON(bucket, object, fs.storage)
|
uploadsJSON, err := readUploadsJSON(bucket, object, fs.storage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", toObjectErr(traceError(err), minioMetaBucket, object)
|
return "", toObjectErr(err, minioMetaBucket, object)
|
||||||
}
|
}
|
||||||
// If we have successfully read `uploads.json`, then we proceed to
|
// If we have successfully read `uploads.json`, then we proceed to
|
||||||
// purge or update `uploads.json`.
|
// purge or update `uploads.json`.
|
||||||
@ -771,7 +771,7 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload
|
|||||||
}
|
}
|
||||||
if len(uploadsJSON.Uploads) > 0 {
|
if len(uploadsJSON.Uploads) > 0 {
|
||||||
if err = fs.updateUploadsJSON(bucket, object, uploadsJSON); err != nil {
|
if err = fs.updateUploadsJSON(bucket, object, uploadsJSON); err != nil {
|
||||||
return "", toObjectErr(traceError(err), minioMetaBucket, path.Join(mpartMetaPrefix, bucket, object))
|
return "", toObjectErr(err, minioMetaBucket, path.Join(mpartMetaPrefix, bucket, object))
|
||||||
}
|
}
|
||||||
// Return success.
|
// Return success.
|
||||||
return s3MD5, nil
|
return s3MD5, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user