ivandika3 commented on code in PR #10984:
URL: https://github.com/apache/ozone/pull/10984#discussion_r3764539166
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java:
##########
@@ -944,6 +944,12 @@ public static long sumBlockLengths(OmKeyInfo omKeyInfo) {
/**
* Return bucket info for the specified bucket.
+ * <p>
+ * The returned {@link OmBucketInfo} is the cached instance, returned by
+ * reference. A caller that mutates it (for example quota accounting) before
a
+ * point where the request may still fail must first take a
+ * {@link OmBucketInfo#copyObject()} and publish that copy only on success,
+ * otherwise a failed request leaks the mutation into the cache.
*/
@Nullable
public static OmBucketInfo getBucketInfo(OMMetadataManager omMetadataManager,
Review Comment:
We can pursue OmBucketInfo immutability
https://issues.apache.org/jira/browse/HDDS-10317, mutable OmBucketInfo has been
a source of some bugs.
--
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]