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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyDeleteResponse.java:
##########
@@ -83,22 +83,26 @@ public void addToDBBatch(OMMetadataManager 
omMetadataManager,
         omMetadataManager.getBucketKey(omBucketInfo.getVolumeName(),
             omBucketInfo.getBucketName()), omBucketInfo);
 
-    // Remove open key (necessary when the file is hsync'ed but not committed)
-    if (dbOpenKey != null) {
-      omMetadataManager.getOpenKeyTable(getBucketLayout()).deleteWithBatch(
-          batchOperation, dbOpenKey);
+    // necessary when the file is hsync'ed but not committed
+    // Update metadata which will be used to cleanup openKey in 
openKeyCleanupService
+    if (!openKeyInfoMap.isEmpty()) {
+      for (Map.Entry<String, OmKeyInfo> entry : openKeyInfoMap.entrySet()) {
+        omMetadataManager.getOpenKeyTable(getBucketLayout()).putWithBatch(
+            batchOperation, entry.getKey(), entry.getValue());

Review Comment:
   @ashishkumar50 , since the file is kept in openKeyTable for lazy deletion, 
we shall also need to check this "DELETED_HSYNC_KEY" flag in allocateBlock, 
commitKey and recoverLease request. 



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