sumitagrawl commented on code in PR #7349:
URL: https://github.com/apache/ozone/pull/7349#discussion_r1830597235
##########
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:
IMO,
get() will be synchronized for 1 unit of time, and processing will take 5-10
unit of time minimum as, it processing involves,
- search in file table
- search in directory table
- prepare request
So this contention will not have much impact in processing with default 10
threads. Just keep simple instead of having cache / or other mechanism.
--
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]