chungen0126 commented on code in PR #11918:
URL: https://github.com/apache/ozone/pull/11918#discussion_r4508859021
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -2373,6 +2373,21 @@ public OmMultipartUploadCompleteInfo
completeMultipartUpload(
public OmMultipartUploadCompleteInfo completeMultipartUpload(String
volumeName, String bucketName, String keyName,
String uploadID, Map<Integer, String> partsMap, Long
expectedDataGeneration, String expectedETag,
String excludedETag) throws IOException {
+ return completeMultipartUpload(volumeName, bucketName, keyName, uploadID,
partsMap, expectedDataGeneration,
+ expectedETag, excludedETag, null);
+ }
+
+ @Override
+ @SuppressWarnings("checkstyle:parameternumber")
+ public OmMultipartUploadCompleteInfo completeMultipartUpload(String
volumeName, String bucketName, String keyName,
+ String uploadID, Map<Integer, String> partsMap, Long
expectedDataGeneration, String expectedETag,
+ String excludedETag, Long expectedDataSize) throws IOException {
+ if (expectedDataSize != null) {
+ Preconditions.checkArgument(expectedDataSize >= 0, "Expected object size
must be non-negative");
+ if
(!OzoneManagerVersion.S3_MULTIPART_OBJECT_SIZE.isSupportedBy(omVersion)) {
+ throw new IOException("OzoneManager does not support the expected
multipart object size.");
+ }
+ }
Review Comment:
Instead of rejecting the request when OM doesn't support
`S3_MULTIPART_OBJECT_SIZE`, should we just skip the validation and let the
multipart upload complete normally?
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCompleteRequest.java:
##########
@@ -128,6 +128,12 @@ public OMRequest preExecute(OzoneManager ozoneManager)
throws IOException {
if (keyArgs.hasExcludedETag()) {
ozoneManager.checkFeatureEnabled(OzoneManagerVersion.S3_IF_NONE_MATCH_ETAG);
}
+ if (keyArgs.hasDataSize()) {
+
ozoneManager.checkFeatureEnabled(OzoneManagerVersion.S3_MULTIPART_OBJECT_SIZE);
Review Comment:
On the OM side, I think we should ensure consistency across all OMs. We
should only validate the object size once all OMs support
`S3_MULTIPART_OBJECT_SIZE. Otherwise`, if not all OMs are upgraded, they should
all skip this check.
Using `checkFeatureEnabled` is not for version checking, but rather for
disabling features based on configuration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]