HDDS-15895. Make ServerNotLeaderException suggested leader flow IPv6-safe#10807
Open
chihsuan wants to merge 2 commits into
Open
HDDS-15895. Make ServerNotLeaderException suggested leader flow IPv6-safe#10807chihsuan wants to merge 2 commits into
chihsuan wants to merge 2 commits into
Conversation
chihsuan
marked this pull request as ready for review
July 19, 2026 04:10
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.
What changes were proposed in this pull request?
ServerNotLeaderExceptioncarries the SCM suggested-leader address through its exception message. The IPv6 fast path was broken at three points:2001:db8::1:9863.This change fixes the complete flow:
HddsUtils.getHostPortString, producing[2001:db8::1]:9863for IPv6 while leaving hostname and IPv4 output unchanged.SUGGESTED_LEADER_PATTERNto accept bracketed IPv6 without changing the existing non-IPv6 parsing behavior.NetUtils.createSocketAddrand match it against the configured SCMInetSocketAddressinstead of comparing strings.The result is that IPv6 clients can use the suggested-leader fast path instead of probing SCM nodes in round-robin order.
This issue was found while reviewing HDDS-15773 and kept separate because the message producer, parser, and functional consumer need to change together.
What is the link to the Apache JIRA?
https://issues.apache.org/jira/browse/HDDS-15895
How was this patch tested?
Added an IPv6 conversion and message round-trip test for
ServerNotLeaderException.Added a wired three-SCM failover test where the suggested leader is not the next round-robin node. This verifies that the IPv6 hint selects the intended SCM instead of passing accidentally through normal round-robin failover.
Ran:
Generated-by: Claude Code (Claude Opus 4.8)