HDFS-17824. DataNode fails to start when dfs.datanode.directoryscan.t…#8309
HDFS-17824. DataNode fails to start when dfs.datanode.directoryscan.t…#8309deepujain wants to merge 1 commit intoapache:trunkfrom
Conversation
|
💔 -1 overall
This message was automatically generated. |
15fe655 to
032cd21
Compare
1de9f63 to
686548d
Compare
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
686548d to
21d2f16
Compare
|
Rebased onto current apache/trunk and force-pushed the branch. Local verification:
Current branch head: 21d2f16. |
|
💔 -1 overall
This message was automatically generated. |
21d2f16 to
4e6a6f2
Compare
|
Refreshed the branch to a new single-commit SHA and force-pushed so Yetus can rerun cleanly. The latest red unit and shadedclient checks both failed with pthread_create failed (EAGAIN) / unable to create native thread, so they look like CI resource-limit failures rather than patch-specific regressions. Local validation passed with mvn -Dmaven.repo.local=/tmp/codex-m2 test -pl hadoop-hdfs-project/hadoop-hdfs -am -Dtest=TestDirectoryScanner#testInvalidDirectoryScanThreadsUsesDefault,TestBalancerWithHANameNodes -DskipTests=false. Ready for another CI spin. |
4e6a6f2 to
ebc7a88
Compare
|
Rebased this onto current apache/trunk and force-pushed the refreshed branch. Local validation passed with JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home /opt/homebrew/bin/mvn -Dmaven.repo.local=/tmp/codex-m2 test -pl hadoop-hdfs-project/hadoop-hdfs -am -Dtest=TestDirectoryScanner#testInvalidDirectoryScanThreadsUsesDefault,TestBalancerWithHANameNodes -DskipTests=false (6 tests, 0 failures). |
…hreads is 0 or negative.
ebc7a88 to
cbeabd2
Compare
|
Rebased this onto current apache/trunk again after trunk moved ahead and the GitHub merge check fell back to 'This commit cannot be built'. Force-pushed the refreshed branch at cbeabd2. Local validation passed with JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home /opt/homebrew/bin/mvn -Dmaven.repo.local=/tmp/codex-m2 test -pl hadoop-hdfs-project/hadoop-hdfs -am -Dtest=TestDirectoryScanner#testInvalidDirectoryScanThreadsUsesDefault,TestBalancerWithHANameNodes -DskipTests=false (6 tests, 0 failures). |
|
🎊 +1 overall
This message was automatically generated. |
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