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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java:
##########
@@ -217,9 +218,19 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
       // creation and key commit, old versions will be just overwritten and
       // not kept. Bucket versioning will be effective from the first key
       // creation after the knob turned on.
+      boolean isPreviousCommitHsync = false;
       Map<String, RepeatedOmKeyInfo> oldKeyVersionsToDeleteMap = null;
       OmKeyInfo keyToDelete =
           omMetadataManager.getKeyTable(getBucketLayout()).get(dbOzoneKey);
+      if (null != keyToDelete) {
+        final String clientIdString
+            = String.valueOf(commitKeyRequest.getClientID());
+        isPreviousCommitHsync = java.util.Optional.ofNullable(keyToDelete)

Review Comment:
   Thanks @sumitagrawl .
   
   I see you are using `keyToDelete` (from `KeyTable`) instead of `omKeyInfo` 
(from `OpenKeyTable`) here from the 
[previous](https://github.com/apache/ozone/pull/5167#discussion_r1290061020) 
patch file. Looks like this should work.
   
   This correctly forces subsequent hsync OR final commit to fall into the 
first code path (line 263). And I assume any allocated but committed blocks 
will still be cleaned up by `uncommitted` logic below?



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