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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMDirectoriesPurgeRequestWithFSO.java:
##########
@@ -120,7 +120,11 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, TermIn
             long parentId = keyInfo.getParentObjectID();
             dbOpenKey = omMetadataManager.getOpenFileName(path.getVolumeId(), 
path.getBucketId(),
                 parentId, keyInfo.getFileName(), hsyncClientId);
-            openKeyRemovalList.add(dbOpenKey);
+            OmKeyInfo openKeyInfo = 
omMetadataManager.getOpenKeyTable(getBucketLayout()).get(dbOpenKey);
+            if (openKeyInfo != null) {
+              openKeyInfo.getMetadata().put(DELETED_HSYNC_KEY, "true");

Review Comment:
   Tell me if this would happen:
   
   - When the same client (with the same client ID, thus same `dbOpenKey`) is 
allowed to write to the same path, the `openKeyTable` (`openFileTable`) entry 
will be overwritten, still leading to orphan blocks.
   
   On the other hand, it also doesn't make sense to block the same client from 
writing to the same key path, just because the key is deleted by another client 
or because the key is errorneously deleted without being close()d first.



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