mirror of
https://github.com/minio/minio.git
synced 2025-01-23 12:43:16 -05:00
Remove error returned when part sizes are un-equal (#6183)
Since implementing `pwrite` like implementation would require a more complex code than background append implementation, it is better to keep the current code as is and not implement `pwrite` based functionality. Closes #4881
This commit is contained in:
parent
20480ba3f7
commit
2debe77586
@ -169,7 +169,6 @@ const (
|
|||||||
ErrInvalidResourceName
|
ErrInvalidResourceName
|
||||||
ErrServerNotInitialized
|
ErrServerNotInitialized
|
||||||
ErrOperationTimedOut
|
ErrOperationTimedOut
|
||||||
ErrPartsSizeUnequal
|
|
||||||
ErrInvalidRequest
|
ErrInvalidRequest
|
||||||
// Minio storage class error codes
|
// Minio storage class error codes
|
||||||
ErrInvalidStorageClass
|
ErrInvalidStorageClass
|
||||||
@ -785,11 +784,6 @@ var errorCodeResponse = map[APIErrorCode]APIError{
|
|||||||
Description: "Your metadata headers are not supported.",
|
Description: "Your metadata headers are not supported.",
|
||||||
HTTPStatusCode: http.StatusBadRequest,
|
HTTPStatusCode: http.StatusBadRequest,
|
||||||
},
|
},
|
||||||
ErrPartsSizeUnequal: {
|
|
||||||
Code: "XMinioPartsSizeUnequal",
|
|
||||||
Description: "All parts except the last part should be of the same size.",
|
|
||||||
HTTPStatusCode: http.StatusBadRequest,
|
|
||||||
},
|
|
||||||
ErrObjectTampered: {
|
ErrObjectTampered: {
|
||||||
Code: "XMinioObjectTampered",
|
Code: "XMinioObjectTampered",
|
||||||
Description: errObjectTampered.Error(),
|
Description: errObjectTampered.Error(),
|
||||||
@ -970,8 +964,6 @@ func toAPIErrorCode(err error) (apiErr APIErrorCode) {
|
|||||||
apiErr = ErrEntityTooLarge
|
apiErr = ErrEntityTooLarge
|
||||||
case UnsupportedMetadata:
|
case UnsupportedMetadata:
|
||||||
apiErr = ErrUnsupportedMetadata
|
apiErr = ErrUnsupportedMetadata
|
||||||
case PartsSizeUnequal:
|
|
||||||
apiErr = ErrPartsSizeUnequal
|
|
||||||
case BucketPolicyNotFound:
|
case BucketPolicyNotFound:
|
||||||
apiErr = ErrNoSuchBucketPolicy
|
apiErr = ErrNoSuchBucketPolicy
|
||||||
case *event.ErrInvalidEventName:
|
case *event.ErrInvalidEventName:
|
||||||
|
@ -543,25 +543,11 @@ func (fs *FSObjects) CompleteMultipartUpload(ctx context.Context, bucket string,
|
|||||||
|
|
||||||
// All parts except the last part has to be atleast 5MB.
|
// All parts except the last part has to be atleast 5MB.
|
||||||
if !isMinAllowedPartSize(fi.Size()) {
|
if !isMinAllowedPartSize(fi.Size()) {
|
||||||
err = PartTooSmall{
|
return oi, PartTooSmall{
|
||||||
PartNumber: part.PartNumber,
|
PartNumber: part.PartNumber,
|
||||||
PartSize: fi.Size(),
|
PartSize: fi.Size(),
|
||||||
PartETag: part.ETag,
|
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{}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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."
|
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.
|
// PartTooSmall - error if part size is less than 5MB.
|
||||||
type PartTooSmall struct {
|
type PartTooSmall struct {
|
||||||
PartSize int64
|
PartSize int64
|
||||||
|
Loading…
x
Reference in New Issue
Block a user