HDDS-16138. Add compatibility coverage for SCM Ratis role output over IPv6 - #11049
Open
rjgoyln wants to merge 2 commits into
Open
HDDS-16138. Add compatibility coverage for SCM Ratis role output over IPv6#11049rjgoyln wants to merge 2 commits into
rjgoyln wants to merge 2 commits into
Conversation
… IPv6 The encoded SCM Ratis role string is a wire format shared by the roles CLI, safe-mode leader detection, the JMX view behind the SCM web UI, and Recon's snapshot download. After HDDS-15774 made the encoding IPv6-safe, only the producer and the roles table were covered, so a regression in the encoding or in any of the other consumers would surface as a runtime failure in an IPv6 deployment rather than as a test failure. Leader detection in `ozone admin safemode status` could not be reached from a test because the subcommand builds its own client, so findLeaderNode now takes the node list as a parameter instead of reading the field.
rjgoyln
marked this pull request as ready for review
August 21, 2026 17:46
smengcl
reviewed
Aug 21, 2026
Contributor
|
Thanks @rjgoyln for the additions. Can you enable GH actions in your fork so CI can run? https://github.com/rjgoyln/ozone/settings/actions |
SCM sets an address on every RaftPeer it builds, so describing the empty entry as producer output overstated a path the code does not reach. The cases stay as malformed-input coverage.
Author
Thank you! Actions are enabled on the fork now, and build-branch is running against the latest push. |
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?
The colon-delimited SCM Ratis role string is a wire format with four independent readers — the JMX view behind the SCM web UI,
ozone admin scm roles, leader detection inozone admin safemode status, and Recon's snapshot download — and none of them own it. HDDS-15774 made the encoding and the shared parser IPv6-safe but left most of those readers untested, and the JMX view, which reorders the fields, had no test at all. A change to the encoding today shifts its columns and breaks leader selection silently, surfacing as a runtime failure in an IPv6 deployment rather than as a test failure.This pins the format and covers each reader. The producer's output is asserted verbatim instead of being round-tripped through the parser, which is what actually holds the brackets and the field order in place; the DNS case asserts only the fields the encoding owns, so it does not depend on what the name resolves to. The existing IPv6 table test moves from substring matching to pinning every column. The JMX and safe-mode tests also cover malformed role strings because these consumers handle parser failures differently.
No behaviour changes.
SafeModeCheckSubcommand.findLeaderNodewas unreachable from a test because the subcommand builds its ownScmClient, so it now takes the node list as a parameter rather than reading the field, and the statelessmatchesAddressbecomes static with it.Two things are left for reviewers to weigh:
findLeaderNodenow reads only other objects' data and arguably belongs besideSCMNodeInfo, and the positionalString[]indexing remains the underlying awkwardness — HDDS-15774 raised a structured representation as the alternative, which this JIRA scopes out.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16138
How was this patch tested?
Unit tests only:
TestSCMRatisServerImpl,TestStorageContainerManagerRatisRoles(new),TestGetScmRatisRolesSubcommand,TestSafeModeCheckSubcommand(new),TestStorageContainerServiceProviderImpl. Checkstyle, RAT and SpotBugs are clean across the three modules touched.Generated-by: Claude Code (Opus 5)