smengcl commented on code in PR #6046:
URL: https://github.com/apache/ozone/pull/6046#discussion_r1463905295


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java:
##########
@@ -263,10 +264,18 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, TermIn
       omKeyInfo.getMetadata().putAll(KeyValueUtil.getFromProtobuf(
           commitKeyArgs.getMetadataList()));
 
+      // flag to indicate whether it is necessary to update the value (ozone 
key) in OpenKeyTable
+      boolean updateOpenKeyTable = false;
+
       if (isHSync) {
+        updateOpenKeyTable = !OmKeyHSyncUtil.isHSyncedPreviously(omKeyInfo, 
clientIdString, dbOpenKey);
         omKeyInfo.getMetadata().put(OzoneConsts.HSYNC_CLIENT_ID, 
clientIdString);
       } else if (isRecovery) {
+        // Q for Sammi/Wei-Chiu: The following line won't do anything (before 
this PR) because HSYNC_CLIENT_ID was never
+        // added to OpenKeyTable right? Have I missed something?

Review Comment:
   Hmm. While you are right that `OMRecoverLeaseRequest` could return either 
`keyInfo` or `openKeyInfo` here:
   
   
https://github.com/apache/ozone/blob/04b6aa5e75ff0434043177c54e626a829a156032/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMRecoverLeaseRequest.java#L275-L276
   
   but it still wouldn't update `OpenKeyTable` with `keyInfo` from `KeyTable` 
right? i.e.:
   
   1. update `OpenKeyTable` cache
   
   
https://github.com/apache/ozone/blob/04b6aa5e75ff0434043177c54e626a829a156032/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMRecoverLeaseRequest.java#L239-L241
   
   2. update `OpenKeyTable`
   
   
https://github.com/apache/ozone/blob/b16087aa6c2d39bf98314b7a2e6d4811131ac26d/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/file/OMRecoverLeaseResponse.java#L65-L69



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