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


##########
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:
   Not really. The OMRecoverLeaseRequest will return either keyInfo or 
openKeyInfo depending on which one has the lastest block information, so that 
commitKeyArgs will either have HSYNC_CLIENT_ID metadata or LEASE_RECOVERY. 



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