diff --git a/cmd/api-errors.go b/cmd/api-errors.go index bb1cd5de9..de9a9c8f5 100644 --- a/cmd/api-errors.go +++ b/cmd/api-errors.go @@ -169,7 +169,6 @@ const ( ErrInvalidResourceName ErrServerNotInitialized ErrOperationTimedOut - ErrPartsSizeUnequal ErrInvalidRequest // Minio storage class error codes ErrInvalidStorageClass @@ -785,11 +784,6 @@ var errorCodeResponse = map[APIErrorCode]APIError{ Description: "Your metadata headers are not supported.", HTTPStatusCode: http.StatusBadRequest, }, - ErrPartsSizeUnequal: { - Code: "XMinioPartsSizeUnequal", - Description: "All parts except the last part should be of the same size.", - HTTPStatusCode: http.StatusBadRequest, - }, ErrObjectTampered: { Code: "XMinioObjectTampered", Description: errObjectTampered.Error(), @@ -970,8 +964,6 @@ func toAPIErrorCode(err error) (apiErr APIErrorCode) { apiErr = ErrEntityTooLarge case UnsupportedMetadata: apiErr = ErrUnsupportedMetadata - case PartsSizeUnequal: - apiErr = ErrPartsSizeUnequal case BucketPolicyNotFound: apiErr = ErrNoSuchBucketPolicy case *event.ErrInvalidEventName: diff --git a/cmd/fs-v1-multipart.go b/cmd/fs-v1-multipart.go index 6459a84c6..bb6526332 100644 --- a/cmd/fs-v1-multipart.go +++ b/cmd/fs-v1-multipart.go @@ -543,25 +543,11 @@ func (fs *FSObjects) CompleteMultipartUpload(ctx context.Context, bucket string, // All parts except the last part has to be atleast 5MB. if !isMinAllowedPartSize(fi.Size()) { - err = PartTooSmall{ + return oi, PartTooSmall{ PartNumber: part.PartNumber, PartSize: fi.Size(), PartETag: part.ETag, } - logger.LogIf(ctx, err) - return oi, err - } - - // TODO: Make necessary changes in future as explained in the below comment. - // All parts except the last part has to be of same size. We are introducing this - // check to see if any clients break. If clients do not break then we can optimize - // multipart PutObjectPart by writing the part at the right offset using pwrite() - // so that we don't need to do background append at all. i.e by the time we get - // CompleteMultipartUpload we already have the full file available which can be - // renamed to the main name-space. - if partSize != fi.Size() { - logger.LogIf(ctx, PartsSizeUnequal{}) - return oi, PartsSizeUnequal{} } } diff --git a/cmd/object-api-errors.go b/cmd/object-api-errors.go index 077135a7a..5a8694ff9 100644 --- a/cmd/object-api-errors.go +++ b/cmd/object-api-errors.go @@ -320,13 +320,6 @@ func (e InvalidPart) Error() string { return "One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag." } -// PartsSizeUnequal - All parts except the last part should be of the same size -type PartsSizeUnequal struct{} - -func (e PartsSizeUnequal) Error() string { - return "All parts except the last part should be of the same size" -} - // PartTooSmall - error if part size is less than 5MB. type PartTooSmall struct { PartSize int64