Skip to content

HDDS-16831. Make remaining host and port concatenations IPv6-safe - #11462

Merged
jojochuang merged 1 commit into
apache:masterfrom
smengcl:HDDS-16831
Oct 12, 2026
Merged

jojochuang merged 1 commit into
apache:masterfrom
smengcl:HDDS-16831

Conversation

@smengcl

@smengcl smengcl commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Generated-by: Claude Code (Opus 5.5)

What changes were proposed in this pull request?

Some code paths still build an endpoint with host + ":" + port. With an IPv6 literal this gives an ambiguous value such as 2001:db8::10:9862, which is rejected or parsed incorrectly.

This patch uses HddsUtils.getHostPortString (HDDS-15773) in:

  • DiskBalancerSubCommandUtil: datanode RPC address and the address shown in status and report output
  • ReconfigureSubCommandUtil: datanode address list for batch reconfig
  • GrpcOMFailoverProxyProvider: OM gRPC address
  • BaseInsightSubCommand: datanode URL for ozone insight

DNS and IPv4 output is unchanged.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-16831

How was this patch tested?

Added IPv6 cases to TestDiskBalancerSubCommandUtil, TestBaseInsightSubCommand and TestGrpcOmTransport, and added TestReconfigureSubCommandUtil. The new cases fail without the fix.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 10, 2026 00:49

Copilot AI 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.

🟢 Approval recommended

The endpoint changes consistently use the established helper and include focused regression coverage.

0 open findings

What changed in this PR

Makes endpoint construction IPv6-safe across OM gRPC, admin CLI, and Insight paths.

Changes:

  • Uses HddsUtils.getHostPortString for host/port formatting.
  • Preserves DNS/IPv4 output while bracketing IPv6 literals.
  • Adds focused IPv6 regression tests.
File Description
TestGrpcOmTransport.java Tests IPv6 OM gRPC initialization.
TestBaseInsightSubCommand.java Tests datanode IPv6 URLs.
BaseInsightSubCommand.java Safely formats datanode URLs.
GrpcOMFailoverProxyProvider.java Safely formats OM gRPC addresses.
TestReconfigureSubCommandUtil.java Tests IPv4, IPv6, and dead-node filtering.
TestDiskBalancerSubCommandUtil.java Tests IPv6 RPC and display addresses.
ReconfigureSubCommandUtil.java Safely formats batch reconfiguration addresses.
DiskBalancerSubCommandUtil.java Safely formats RPC and displayed datanode addresses.

🧠 Review effort: Balanced


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

@smengcl smengcl added the AI-gen label Oct 10, 2026
@smengcl
smengcl marked this pull request as ready for review October 10, 2026 04:53
@adoroszlai

adoroszlai commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

TestPerVolumePushReplication.testDecommissionWithPerVolumePools was flaky and fixed on master. Please do not re-run.

@smengcl
smengcl requested a review from Gargi-jais11 October 11, 2026 21:55

@rich7420 rich7420 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.

LGTM

@jojochuang
jojochuang merged commit e995b51 into apache:master Oct 12, 2026
71 of 72 checks passed
@jojochuang

Copy link
Copy Markdown
Contributor

Merged. Thanks @smengcl @adoroszlai @rich7420

@smengcl

smengcl commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @rich7420 @jojochuang @adoroszlai for the reviews.

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