anuragp010 commented on code in PR #11716:
URL: https://github.com/apache/ozone/pull/11716#discussion_r4610059489
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMAllocateBlockRequest.java:
##########
@@ -123,6 +121,23 @@ public OMRequest preExecute(OzoneManager ozoneManager)
throws IOException {
resolveBucketAndCheckOpenKeyAcls(newKeyArgs.build(), ozoneManager,
ACLType.WRITE, allocateBlockRequest.getClientID());
+ // An older client does not send the storage policy in allocateBlock
requests. Using the bucket policy for them
+ // is wrong when the bucket policy changes while the key is being written.
Review Comment:
Thanks for the review, @amaliujia !
I have reworded the comment with one minor tweak to your suggestion: I
omitted "keys opened without a policy".
Once the storage policy feature is finalized, if a key is created without
the client explicitly passing a policy, it is resolved during the
`createKey`/`createFile` request's `preExecute` phase on the OM. As a result,
the `OMKeyInfo` object sent back to the client already contains a storage
policy. This same `OMKeyInfo` object is then used for subsequent allocateBlock
calls. Therefore, the scenario addressed by this PR will only occur with older
clients.
--
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]