anuragp010 commented on code in PR #11626:
URL: https://github.com/apache/ozone/pull/11626#discussion_r4496111732
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3InitiateMultipartUploadRequest.java:
##########
@@ -90,12 +92,23 @@ public OMRequest preExecute(OzoneManager ozoneManager)
throws IOException {
keyPath = validateAndNormalizeKey(ozoneManager.getEnableFileSystemPaths(),
keyPath, getBucketLayout());
+ final OmBucketInfo bucketInfo = ozoneManager
+ .getBucketInfo(keyArgs.getVolumeName(), keyArgs.getBucketName());
+
KeyArgs.Builder newKeyArgs = keyArgs.toBuilder()
.setMultipartUploadID(
OMMultipartUploadUtils.getMultipartUploadId())
.setModificationTime(Time.now())
.setKeyName(keyPath);
+ // Stamp the policy only once finalized: an OM without storage policy
support ignores the field, so stamping it
+ // earlier would make old and new OMs apply this request differently.
Clearing also drops a client-sent value.
+ if
(ozoneManager.getVersionManager().isAllowed(OMLayoutFeature.STORAGE_POLICY_SUPPORT))
{
+
newKeyArgs.setStoragePolicy(OzoneStoragePolicy.toProto(getStoragePolicy(bucketInfo,
keyArgs)));
+ } else {
+ newKeyArgs.clearStoragePolicy();
+ }
Review Comment:
Thanks @devmadhuu for clarifying.
Post ZDU, the following approach was taken.
1. If a storage policy is passed to the initiateMPU command pre
finalization, the request must be rejected with an
`NOT_SUPPORTED_OPERATION_PRIOR_FINALIZATION` error code. Hence,
`disallowInitiateMultiPartUploadWithStoragePolicy` is added.
2. According to the ZDU framework, only `OzoneManagerVersion` must be
modified when adding a new feature and both client side version check and
server side layout check must use the same. Hence I have followed the same.
3. Followed the suggestion for point 3 on client behaviour. As of now, no
client passed default will exist. OM determines the default values for the
requests.
4. Thanks for creating
[HDDS-17528](https://issues.apache.org/jira/browse/HDDS-17528) . Will handle
accordingly.
--
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]