HDFS-17824. DataNode fails to start when dfs.datanode.directoryscan.t…#8309
Open
deepujain wants to merge 2 commits intoapache:trunkfrom
Open
HDFS-17824. DataNode fails to start when dfs.datanode.directoryscan.t…#8309deepujain wants to merge 2 commits intoapache:trunkfrom
deepujain wants to merge 2 commits intoapache:trunkfrom
Conversation
|
💔 -1 overall
This message was automatically generated. |
…hreads is 0 or negative. Validate directoryscan.threads; if <= 0 log warning and use default (1) so DataNode starts instead of throwing from newFixedThreadPool.
15fe655 to
032cd21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
dfs.datanode.directoryscan.threadsis set to 0 or a negative value, the DataNode throwsIllegalArgumentExceptionfromExecutors.newFixedThreadPool(threads)during DirectoryScanner initialization and fails to start. This change validates the config and uses the default (1) when the value is non-positive, with a warning log, so the DataNode starts and the operator sees a clear message.Change
dfs.datanode.directoryscan.threads, if the value is ≤ 0, log a warning (parameter name, invalid value, default) and set threads toDFS_DATANODE_DIRECTORYSCAN_THREADS_DEFAULT(1) before creating the thread pool. Matches the existing pattern used forreconcile.blocks.batch.sizeandreconcile.blocks.batch.intervalin the same class.testInvalidDirectoryScanThreadsUsesDefault()— setdirectoryscan.threadsto 0, build a minimal cluster, create and start DirectoryScanner; verifies no exception and scanner runs (HDFS-17824).JIRA
Fixes HDFS-17824