mirror of
https://github.com/minio/minio.git
synced 2025-11-22 18:47:43 -05:00
Multipart: Minimum part size limit does not apply to the last part during CompleteMultipartUpload. (#1518) (#1538)
This commit is contained in:
committed by
Harshavardhana
parent
90ea494338
commit
04a5b25929
@@ -124,7 +124,7 @@ func (xl xlObjects) CompleteMultipartUpload(bucket string, object string, upload
|
||||
var wg = &sync.WaitGroup{}
|
||||
|
||||
// Loop through all parts, validate them and then commit to disk.
|
||||
for _, part := range parts {
|
||||
for i, part := range parts {
|
||||
// Construct part suffix.
|
||||
partSuffix := fmt.Sprintf("%.5d.%s", part.PartNumber, part.ETag)
|
||||
multipartPartFile := path.Join(mpartMetaPrefix, bucket, object, uploadID, partSuffix)
|
||||
@@ -136,7 +136,8 @@ func (xl xlObjects) CompleteMultipartUpload(bucket string, object string, upload
|
||||
}
|
||||
return "", err
|
||||
}
|
||||
if !isMinAllowedPartSize(fi.Size) {
|
||||
// All parts except the last part has to be atleast 5MB.
|
||||
if (i < len(parts)-1) && !isMinAllowedPartSize(fi.Size) {
|
||||
return "", PartTooSmall{}
|
||||
}
|
||||
// Update metadata parts.
|
||||
|
||||
Reference in New Issue
Block a user