errose28 commented on code in PR #11642:
URL: https://github.com/apache/ozone/pull/11642#discussion_r4339795569


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java:
##########
@@ -156,6 +158,15 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
           ozoneTokenIdentifier.getRenewer() == null ? "" :
               ozoneTokenIdentifier.getRenewer().toString());
 
+      // The token was validated in preExecute, but a cancel or another renew 
may have been applied since then.
+      if 
(ozoneManager.getDelegationTokenMgr().isCanceled(ozoneTokenIdentifier)) {
+        throw new OMException("Delegation token has been canceled: " + 
ozoneTokenIdentifier, TOKEN_ERROR_OTHER);
+      }
+      Long storedRenewTime = 
omMetadataManager.getDelegationTokenTable().get(ozoneTokenIdentifier);
+      if (storedRenewTime != null) {
+        renewTime = Math.min(ozoneTokenIdentifier.getMaxDate(), 
Math.max(renewTime, storedRenewTime));
+      }

Review Comment:
   Since we won't support ZDU to the release that this goes out in this change 
is ok, but under ZDU this type of change could cause divergence. If the token 
was cancelled before processing, the new OMs would fail the request but old OMs 
would still apply it.
   
   If we needed ZDU support we would wrap this in a version check. Component 
versions are going to be much more common in the time frame between ZDU support 
and the leader execution project. That's ok since they are enum entries/feature 
flags which are cheap.
   
   HDDS-17252 will be able to add comments like this to PRs automatically to 
make it less likely to slip through.



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