fmorg-git commented on code in PR #10203:
URL: https://github.com/apache/ozone/pull/10203#discussion_r3424898175


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocol/OzoneManagerProtocol.java:
##########
@@ -252,6 +253,17 @@ default void commitKey(OmKeyArgs args, long clientID)
         "this to be implemented, as write requests use a new approach.");
   }
 
+  /**
+   * Commit a key and optionally return the stored modification time (epoch 
millis).
+   * <p>
+   * This is backward compatible with older OM versions which do not return
+   * the value in {@code CommitKeyResponse}.
+   */
+  default OptionalLong commitKeyWithModificationTime(OmKeyArgs args, long 
clientID) throws IOException {

Review Comment:
   > So without this patch, Ozone now returns incorrect LastModified?
   
   There were two cases previously per my understanding:
   1) CopyObject: the current time was set when the key is committed.  Then an 
extra lookup is performed to find what that modification time is (so it was 
precise).  This patch changes to return the modification time in the 
CommitKeyResponse itself so the extra lookup isn't needed (and this extra 
lookup was breaking STS).
   2) UploadPartCopy: it was just doing an `Instant.now()` in the 
`CopyPartResult` constructor, so the returned LastModified was the gateway's 
wall‑clock at response time, not the OM‑side commit time of the part key
   
   For both these cases, the patch now returns the actual lastModified that was 
set at the time the key was committed in the response itself so that a) no 
extra fetch is needed and b) it is more accurate



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