devmadhuu commented on code in PR #11626:
URL: https://github.com/apache/ozone/pull/11626#discussion_r4314142555
##########
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
Review Comment:
This addition will mandate user to have READ permissions also along with
write. so there is a change in behavior with this line. I think, better to
retrieve the bucket’s policy through an internal metadata lookup. Earlier the
code was just checking only CREATE permissions, now it needs READ also with
this change. So the user who has only WRITE will fail with
`PERMISSION_DENIED`. Add a WRITE-without-READ regression test.
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java:
##########
@@ -1210,9 +1209,11 @@ private OmKeyInfo prepareMultipartFileInfo(
}
// For this upload part we don't need to check in KeyTable. As this
// is not an actual key, it is a part of the key.
+ // The part takes the storage policy of the multipart key, not the one in
args: the client
+ // does not send it when opening a part, and allocateBlock later sends the
policy of this part.
Review Comment:
Agree that upload policy is saved correctly, but block allocation relies on
the client sending that policy back. Older clients do not send this field or
newer client also may not send it explicitly.
**Example:**
1. An upload starts while the bucket policy is COLD—ARCHIVE storage.
2. The bucket policy changes to WARM—DISK storage.
3. An older client uploads a part without sending a policy.
4. OM selects the current bucket policy, WARM, although the saved upload
policy remains COLD.
Should OM use the saved part/upload policy when the request omits it,
retaining legacy behavior when no saved policy exists ?
--
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]