Skip to content

HDDS-13494. DirectoryDeletingService incorrectly waits for all the deleted directories processing #8852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 25, 2025

Conversation

swamirishi
Copy link
Contributor

@swamirishi swamirishi commented Jul 23, 2025

What changes were proposed in this pull request?

Currently while parallely processing deleted directory table, the main thread doesn't wait for all the threads to finish it's set of deleted directory which could lead to main thread prematurely rocksdb iterator and also leading to incorrectly marking the deep cleaned directories.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-13494

How was this patch tested?

Added unit tests for the same.

…leted directories processing

Change-Id: I3b291f36b12af7393ba7299618abbbd8b9f02550
@swamirishi swamirishi requested review from jojochuang and smengcl July 23, 2025 01:14
Change-Id: Ia529ff3102679eb32109920f181bb38c23634cb7

# Conflicts:
#	hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/DirectoryDeletingService.java
Change-Id: Ibe26d77423cdec1da37f8df07a0aa56cb2a5c407
@swamirishi swamirishi marked this pull request as ready for review July 23, 2025 15:12
Copy link
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks valid. Thanks for catching it. A few minor suggestions below:

@@ -76,6 +87,7 @@ private OzoneConfiguration createConfAndInitValues() throws IOException {
ServerUtils.setOzoneMetaDirPath(conf, newFolder.toString());
conf.setTimeDuration(OZONE_DIR_DELETING_SERVICE_INTERVAL, 3000,
TimeUnit.MILLISECONDS);
conf.setInt(OZONE_THREAD_NUMBER_DIR_DELETION, threadCount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated: ozone.thread.number.dir.deletion should be renamed to ozone.om.thread.number.dir.deletion.
Along with a bunch other configuration property names in OMConfigKeys

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets do this as a separate jira

@@ -76,6 +87,7 @@ private OzoneConfiguration createConfAndInitValues() throws IOException {
ServerUtils.setOzoneMetaDirPath(conf, newFolder.toString());
conf.setTimeDuration(OZONE_DIR_DELETING_SERVICE_INTERVAL, 3000,
TimeUnit.MILLISECONDS);
conf.setInt(OZONE_THREAD_NUMBER_DIR_DELETION, threadCount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the default value of the property 10 already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conf gets initialized in the base class. I wanted to explicitly override the value here for the test case.

@@ -555,7 +555,7 @@ private void processDeletedDirsForStore(SnapshotInfo currentSnapshotInfo, KeyMan
return false;
}
}, isThreadPoolActive(deletionThreadPool) ? deletionThreadPool : ForkJoinPool.commonPool());
processedAllDeletedDirs = future.thenCombine(future, (a, b) -> a && b);
processedAllDeletedDirs = processedAllDeletedDirs.thenCombine(future, (a, b) -> a && b);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

Change-Id: Ia1965b32e3dc27f3f83e5648a4b86939fa2c8e14
@swamirishi
Copy link
Contributor Author

@jojochuang Can we merge this particular change?

@jojochuang jojochuang merged commit 3c2e365 into apache:master Jul 25, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants