jojochuang commented on code in PR #9084:
URL: https://github.com/apache/ozone/pull/9084#discussion_r2403663397


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMDirectoriesPurgeRequestWithFSO.java:
##########
@@ -239,17 +242,32 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
       
AUDIT.logWriteFailure(ozoneManager.buildAuditMessageForFailure(OMSystemAction.DIRECTORY_DELETION,
 null, ex));
       throw new IllegalStateException(ex);
     } finally {
-      lockSet.stream().forEach(e -> omMetadataManager.getLock()
-          .releaseWriteLock(BUCKET_LOCK, e.getKey(),
-              e.getValue()));
       for (Map.Entry<Pair<String, String>, OmBucketInfo> entry :
           volBucketInfoMap.entrySet()) {
         entry.setValue(entry.getValue().copyObject());
       }
+      omMetadataManager.getLock().releaseWriteLocks(BUCKET_LOCK, 
bucketLockKeys);
     }
 
     return new OMDirectoriesPurgeResponseWithFSO(
         omResponse.build(), purgeRequests,
         getBucketLayout(), volBucketInfoMap, fromSnapshotInfo, openKeyInfoMap);
   }
+
+  private List<String[]> getBucketLockKeySet(PurgeDirectoriesRequest 
purgeDirsRequest) {
+    if (!purgeDirsRequest.getBucketNameInfosList().isEmpty()) {

Review Comment:
   in this case, does it need not to consider deletedSubFilesList?



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