mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
XL/Multipart: If the part is already uploaded ignore the newly uploaded part. (#1677)
Fixes #1644
This commit is contained in:
parent
71b9341fc7
commit
824c8a39f1
@ -205,6 +205,14 @@ func putObjectPartCommon(storage StorageAPI, bucket string, object string, uploa
|
||||
|
||||
partSuffixMD5 := fmt.Sprintf("%.5d.%s", partID, newMD5Hex)
|
||||
partSuffixMD5Path := path.Join(mpartMetaPrefix, bucket, object, uploadID, partSuffixMD5)
|
||||
if _, err = storage.StatFile(minioMetaBucket, partSuffixMD5Path); err == nil {
|
||||
// Part already uploaded as md5sum matches with the previous part.
|
||||
// Just delete the temporary file.
|
||||
if err = storage.DeleteFile(minioMetaBucket, partSuffixPath); err != nil {
|
||||
return "", toObjectErr(err, minioMetaBucket, partSuffixPath)
|
||||
}
|
||||
return newMD5Hex, nil
|
||||
}
|
||||
err = storage.RenameFile(minioMetaBucket, partSuffixPath, minioMetaBucket, partSuffixMD5Path)
|
||||
if err != nil {
|
||||
if derr := storage.DeleteFile(minioMetaBucket, partSuffixPath); derr != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user