adoroszlai commented on a change in pull request #2754:
URL: https://github.com/apache/ozone/pull/2754#discussion_r733563827



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
##########
@@ -197,6 +197,14 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
           new CacheKey<>(dbOpenKey),
           new CacheValue<>(Optional.absent(), trxnLogIndex));
 
+      // Strip out tokens before adding to cache.
+      // This way during listStatus token information does not pass on to
+      // client when returning from cache.
+      if (ozoneManager.isGrpcBlockTokenEnabled()) {
+        omKeyInfo.getLatestVersionLocations().getLocationList()
+            .forEach(keyInfo -> keyInfo.setToken(null));

Review comment:
       `getLocationList()` is expensive (see HDDS-5384).  Can we make the 
update in this loop above?
   
   
https://github.com/apache/ozone/blob/fbb8cf04dfbc21399f29d18b3a40cde071a21ec0/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java#L149-L152




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