diff --git a/object-common-multipart.go b/object-common-multipart.go index 8907c0174..824e461e4 100644 --- a/object-common-multipart.go +++ b/object-common-multipart.go @@ -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 {