Skip to content

HDFS-17982. RBF should return StandbyException when no Active NameNode is known - #8760

Merged
ZanderXu merged 2 commits into
apache:trunkfrom
CapMoon:HDFS-17982
Oct 14, 2026
Merged

ZanderXu merged 2 commits into
apache:trunkfrom
CapMoon:HDFS-17982

Conversation

@CapMoon

@CapMoon CapMoon commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

HDFS-17982. RBF should return StandbyException when no Active NameNode is known

Description of PR

A Router may have an incomplete view of the NameNodes in a nameservice and know only about Observer NameNodes. When a request must be forwarded to the Active NameNode, the Router skips those Observer candidates and makes no RPC calls. As a result, the collected IOException map is empty.

The current failure handling can treat this empty map as if every candidate failed to connect and return ConnectException. Instead, the Router should return StandbyException so the client can retry the request through another Router.

How was this patch tested?

Add a regression test that invokes a request with only Observer candidates when Observer reads are disabled, and verifies that the Router returns StandbyException when no NameNode RPC is attempted.

@CapMoon

CapMoon commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

@ZanderXu @haiyang1987 @kokonguyen191 Masters, plz check it when you are available

CapMoon added a commit to CapMoon/hadoop that referenced this pull request Sep 29, 2026
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 0s Docker mode activated.
-1 ❌ patch 0m 31s #8760 does not apply to trunk. Rebase required? Wrong Branch? See https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute for help.
Subsystem Report/Notes
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8760/3/console
versions git=2.34.1
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@ayushtkn
ayushtkn requested a balanced review from Copilot October 1, 2026 16:03
@ayushtkn

ayushtkn commented Oct 1, 2026

Copy link
Copy Markdown
Member

@CapMoon can u rebase the PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused fix correctly handles the empty exception map and is covered by a regression test.

Review effort: Balanced
Findings: None

What changed in this PR

Corrects Router failure handling when all known NameNodes are skipped Observers.

Changes:

  • Returns StandbyException when no RPC was attempted.
  • Adds asynchronous regression coverage for Observer-only candidates.
File Description
RouterRpcClient.java Distinguishes empty failures from connection failures.
TestRouterAsyncRpcClient.java Verifies the expected retryable exception.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 59s 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.
+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 53m 9s trunk passed
+1 💚 compile 1m 6s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 1m 34s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 0m 56s trunk passed
+1 💚 mvnsite 1m 39s trunk passed
+1 💚 javadoc 1m 4s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 1m 1s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 2m 32s trunk passed
+1 💚 shadedclient 37m 49s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 10s the patch passed
+1 💚 compile 0m 39s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 0m 39s the patch passed
+1 💚 compile 1m 7s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 1m 7s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 27s the patch passed
+1 💚 mvnsite 1m 14s the patch passed
+1 💚 javadoc 0m 33s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 33s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 2m 37s the patch passed
+1 💚 shadedclient 36m 44s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 51m 2s hadoop-hdfs-rbf in the patch passed.
+1 💚 asflicense 0m 43s The patch does not generate ASF License warnings.
200m 5s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8760/5/artifact/out/Dockerfile
GITHUB PR #8760
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 8f551e23a317 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 28f6554
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-8760/5/testReport/
Max. process+thread count 3518 (vs. ulimit of 10000)
modules C: hadoop-hdfs-project/hadoop-hdfs-rbf U: hadoop-hdfs-project/hadoop-hdfs-rbf
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8760/5/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.

@ayushtkn ayushtkn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ZanderXu ZanderXu left a comment

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.

Nice Catch.

LGTM + 1.

@ZanderXu
ZanderXu merged commit f41bb2e into apache:trunk Oct 14, 2026
5 of 6 checks passed
@ZanderXu

Copy link
Copy Markdown
Contributor

Merged. Thanks @CapMoon for your reports and thanks @ayushtkn for your review.

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.

5 participants