Skip to content

HDFS-17996. Make the regular file check in DirectoryScanner configurable - #8825

Open
cxzl25 wants to merge 1 commit into
apache:trunkfrom
cxzl25:HDFS-17996
Open

cxzl25 wants to merge 1 commit into
apache:trunkfrom
cxzl25:HDFS-17996

Conversation

@cxzl25

@cxzl25 cxzl25 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Description of PR

HDFS-16316 added a check to DirectoryScanner#scan that verifies, for every block, that both the block file and the meta file are regular files (FileUtil#isRegularFile with NOFOLLOW_LINKS). The check runs during reconciliation, after the reports of all volumes have been compiled, merged and sorted by block id. It therefore issues two extra lstat calls per block in block id order, which interleaves all volumes and sub-directories and has no locality at all.

How was this patch tested?

Add UT

For code changes:

  • Does the title of this PR start with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: Have the integration tests been executed and the endpoint
    declared according to the connector-specific documentation? Note: Automated CI
    testing doesn't cover all cases so manual testing with cloud storage is still
    required.
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

AI Tooling

If an AI tool was used:

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 35s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 47m 42s trunk passed
+1 💚 compile 1m 50s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 1m 50s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 1m 51s trunk passed
+1 💚 mvnsite 2m 1s trunk passed
+1 💚 javadoc 1m 32s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 1m 29s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 4m 35s trunk passed
+1 💚 shadedclient 35m 18s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 23s the patch passed
+1 💚 compile 1m 18s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 1m 18s the patch passed
+1 💚 compile 1m 21s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 1m 21s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 16s the patch passed
+1 💚 mvnsite 1m 27s the patch passed
+1 💚 javadoc 1m 1s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 1m 2s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 3m 52s the patch passed
+1 💚 shadedclient 31m 12s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 218m 14s hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 40s The patch does not generate ASF License warnings.
359m 37s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8825/1/artifact/out/Dockerfile
GITHUB PR #8825
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 1f999d0a1848 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 2f67be2
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8825/1/testReport/
Max. process+thread count 3334 (vs. ulimit of 10000)
modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8825/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

all volumes have been listed, in block id order across all volumes. On
DataNodes whose number of files exceeds the kernel inode cache this second
pass is a random read on every volume and can take hours; set this to false
to skip it. Blocks that differ in other ways are still checked for regular

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for keeping the check enabled by default.

Could we narrow the last sentence? When a replica exists on disk but is missing from volumeMap, checkAndUpdate() adds it and returns before checking the file type.

I verified that this path can add a symlinked replica with the option disabled.

Please clarify that only some reconciliation paths still check for regular files.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 43s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 xmllint 0m 1s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 46m 56s trunk passed
+1 💚 compile 1m 42s trunk passed with JDK Ubuntu-21.0.13.1+2-1-24.04.1-Ubuntu
+1 💚 compile 1m 47s trunk passed with JDK Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
+1 💚 checkstyle 1m 44s trunk passed
+1 💚 mvnsite 1m 58s trunk passed
+1 💚 javadoc 1m 31s trunk passed with JDK Ubuntu-21.0.13.1+2-1-24.04.1-Ubuntu
+1 💚 javadoc 1m 25s trunk passed with JDK Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
+1 💚 spotbugs 4m 30s trunk passed
+1 💚 shadedclient 33m 2s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 24s the patch passed
+1 💚 compile 1m 21s the patch passed with JDK Ubuntu-21.0.13.1+2-1-24.04.1-Ubuntu
+1 💚 javac 1m 21s the patch passed
+1 💚 compile 1m 22s the patch passed with JDK Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
+1 💚 javac 1m 22s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 19s the patch passed
+1 💚 mvnsite 1m 31s the patch passed
+1 💚 javadoc 0m 58s the patch passed with JDK Ubuntu-21.0.13.1+2-1-24.04.1-Ubuntu
+1 💚 javadoc 1m 4s the patch passed with JDK Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
+1 💚 spotbugs 4m 4s the patch passed
+1 💚 shadedclient 32m 48s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 217m 13s /patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 46s The patch does not generate ASF License warnings.
357m 21s
Reason Tests
Failed junit tests hadoop.hdfs.TestDecommissionWithBackoffMonitor
Subsystem Report/Notes
Docker ClientAPI=1.57 ServerAPI=1.57 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8825/3/artifact/out/Dockerfile
GITHUB PR #8825
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 8f7e1982c7d7 5.15.0-204-generic #214-Ubuntu SMP Fri Nov 6 00:52:52 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 188a8fb
Default Java Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.13.1+2-1-24.04.1-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8825/3/testReport/
Max. process+thread count 3874 (vs. ulimit of 10000)
modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8825/3/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 36s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 43m 46s trunk passed
+1 💚 compile 1m 47s trunk passed with JDK Ubuntu-21.0.13.1+2-1-24.04.1-Ubuntu
+1 💚 compile 1m 48s trunk passed with JDK Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
+1 💚 checkstyle 1m 51s trunk passed
+1 💚 mvnsite 1m 59s trunk passed
+1 💚 javadoc 1m 34s trunk passed with JDK Ubuntu-21.0.13.1+2-1-24.04.1-Ubuntu
+1 💚 javadoc 1m 32s trunk passed with JDK Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
+1 💚 spotbugs 4m 12s trunk passed
+1 💚 shadedclient 32m 44s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 33m 17s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 23s the patch passed
+1 💚 compile 1m 14s the patch passed with JDK Ubuntu-21.0.13.1+2-1-24.04.1-Ubuntu
+1 💚 javac 1m 14s the patch passed
+1 💚 compile 1m 21s the patch passed with JDK Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
+1 💚 javac 1m 21s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 19s the patch passed
+1 💚 mvnsite 1m 26s the patch passed
+1 💚 javadoc 1m 2s the patch passed with JDK Ubuntu-21.0.13.1+2-1-24.04.1-Ubuntu
+1 💚 javadoc 1m 0s the patch passed with JDK Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
+1 💚 spotbugs 3m 53s the patch passed
+1 💚 shadedclient 31m 47s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 213m 16s /patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 43s The patch does not generate ASF License warnings.
348m 33s
Reason Tests
Failed junit tests hadoop.hdfs.server.namenode.TestNameNodeMXBean
Subsystem Report/Notes
Docker ClientAPI=1.57 ServerAPI=1.57 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8825/4/artifact/out/Dockerfile
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux a0972c514593 5.15.0-198-generic #208-Ubuntu SMP Fri Sep 4 10:22:38 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 3b1dab9
Default Java Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.13.1+2-1-24.04.1-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.21.1+2-1-24.04.1-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8825/4/testReport/
Max. process+thread count 4454 (vs. ulimit of 10000)
modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8825/4/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants