ashishkumar50 commented on code in PR #7349: URL: https://github.com/apache/ozone/pull/7349#discussion_r1830388634
########## hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/DirectoryDeletingService.java: ########## @@ -169,27 +210,27 @@ public BackgroundTaskResult call() { = new ArrayList<>((int) remainNum); Table.KeyValue<String, OmKeyInfo> pendingDeletedDirInfo; - - try (TableIterator<String, ? extends KeyValue<String, OmKeyInfo>> - deleteTableIterator = getOzoneManager().getMetadataManager(). - getDeletedDirTable().iterator()) { - // This is to avoid race condition b/w purge request and snapshot chain updation. For AOS taking the global - // snapshotId since AOS could process multiple buckets in one iteration. + // This is to avoid race condition b/w purge request and snapshot chain updation. For AOS taking the global + // snapshotId since AOS could process multiple buckets in one iteration. + try { UUID expectedPreviousSnapshotId = - ((OmMetadataManagerImpl)getOzoneManager().getMetadataManager()).getSnapshotChainManager() + ((OmMetadataManagerImpl) getOzoneManager().getMetadataManager()).getSnapshotChainManager() .getLatestGlobalSnapshotId(); long startTime = Time.monotonicNow(); - while (remainNum > 0 && deleteTableIterator.hasNext()) { - pendingDeletedDirInfo = deleteTableIterator.next(); + while (remainNum > 0) { + pendingDeletedDirInfo = deletedDirSupplier.get(); Review Comment: Can we get multiple pending directories to delete here, so that to decrease probability of all threads to wait for `synchronized get` at the same time. -- 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: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org