tanvipenumudy commented on code in PR #6321:
URL: https://github.com/apache/ozone/pull/6321#discussion_r1671885836


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeysDeleteRequest.java:
##########
@@ -159,9 +166,9 @@ public OMClientResponse validateAndUpdateCache(OzoneManager 
ozoneManager, TermIn
 
         try {
           // check Acl
-          checkKeyAcls(ozoneManager, volumeName, bucketName, keyName,
-              IAccessAuthorizer.ACLType.DELETE, OzoneObj.ResourceType.KEY,
-              volumeOwner);
+          captureLatencyNs(perfMetrics.getDeleteKeysAclCheckLatencyNs(),
+                  () -> checkKeyAcls(ozoneManager, finalVolumeName, 
finalBucketName, keyName,
+              IAccessAuthorizer.ACLType.DELETE, OzoneObj.ResourceType.KEY, 
volumeOwner));

Review Comment:
   Using `finalVolumeName`, `finalBucketName` under the `checkKeyAcls` call 
might cause a change in behaviour. See lines `140`-`141` (where we are updating 
`volumeName`, `bucketName`) under the try block (`finalVolumeName` and 
`finalBucketName` wouldn't get updated in this case).
   
   ```
   volumeName = bucket.realVolume();
   bucketName = bucket.realBucket();
   ```
   
   Due to which, we might need to reintroduce newer variables - which again 
seems unnecessary as we would be allocating newer copies of variables each time 
the call is executed. 
   
   I think we can just keep the metrics capturing simple with the nanos.



-- 
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]

Reply via email to