-
Notifications
You must be signed in to change notification settings - Fork 550
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
Conversation
…leted directories processing Change-Id: I3b291f36b12af7393ba7299618abbbd8b9f02550
Change-Id: Ia529ff3102679eb32109920f181bb38c23634cb7 # Conflicts: # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/DirectoryDeletingService.java
Change-Id: Ibe26d77423cdec1da37f8df07a0aa56cb2a5c407
There was a problem hiding this 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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
...ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/DirectoryDeletingService.java
Show resolved
Hide resolved
...ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/DirectoryDeletingService.java
Show resolved
Hide resolved
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch!
...e-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestDirectoryDeletingService.java
Outdated
Show resolved
Hide resolved
Change-Id: Ia1965b32e3dc27f3f83e5648a4b86939fa2c8e14
@jojochuang Can we merge this particular change? |
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.