Repository navigation
Conversation
… IP literals for Ratis peer addresses Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Retain both the IP-literal Ratis address regression test and the IPv6 SCM peer-address cases while preserving the production changes from both branches. Co-authored-by: Codex (GPT-6) Change-Id: I625e9ddeb2280057d5e4147269ea69dd4d9c7b08
jojochuang
left a comment
There was a problem hiding this comment.
One remaining path can still replace configured IP literals with reverse DNS names before NodeDetails is constructed.
…hecks OzoneNetUtils.isAddressHostNameLocal and getAddressWithHostNameLocal called getHostName() on the configured address, which caches the reverse DNS name in it. With ozone.network.flexible.fqdn.resolution.enabled, OM and SCM run these checks before building node details, so the Ratis peer address still used the reverse DNS name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Non-blocking, nice-to-have, and unrelated to this PR's fix: could we consider validating If null is passed to that constructor, This would be specific to the socket-address constructor; the separate host-string constructor intentionally supports lazy initialization of |
jojochuang
left a comment
There was a problem hiding this comment.
still don't quite get it. Was it not an issue for IPv4? Or perhaps because we never used ip literals to test clusters before?
It is not IPv6 specific. An IPv4 literal goes through the same code. It went unnoticed because our test clusters (compose, MiniOzoneCluster, acceptance) configure OM and SCM addresses by host name. For a configured name, It only matters when the address is configured as an IP literal. Even then it often still works: if every host's reverse lookup returns the same name and that name resolves, the ring forms on the name instead of the literal, and nobody notices. It breaks when hosts get different names for the same IP (a short name from We hit it first on IPv6 because there the literal is the natural choice: the IPv6 compose cluster uses static addresses and configures OM and SCM by literal. |
Generated-by: Claude Code (Opus 5.5)
What changes were proposed in this pull request?
When OM or SCM HA nodes are configured with IP literals (for example on an IPv6 only cluster),
NodeDetailsbuilds the Ratis peer address fromInetSocketAddress.getHostName(), which does a reverse DNS lookup and replaces the literal with whatever name the resolver returns. Several call sites inOMHANodeDetails,OMNodeDetailsandSCMHANodeDetailsalso callgetHostName()before the node details are built, and the lookup result is cached in theInetAddress, so evengetHostString()returns the resolved name afterwards.In a Docker compose cluster with static IPv6 addresses this produces peer addresses like
ozone-ha-scm1-1.ozone-ha_default:9894, which gRPC rejects because of the underscore, so the Ratis rings do not form. SCM also fails to match the leader innotifyInstallSnapshotFromLeaderandresolveTargetPeerIdwhen the stored address differs from the computed one.This PR:
NodeDetailsand replaces the remaininggetHostName()calls on the OM and SCM HA address paths withgetHostString(), so the configured literal is used as is;NodeDetails.isRatisAddress(String), which matches the exact Ratis host and port, or any host that resolves to the node's IP with the Ratis port, so clusters whose Ratis configuration already stores host names keep matching;isRatisAddressfor SCM leader matching inSCMStateMachineandSCMClientProtocolServer.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17205
How was this patch tested?
TestOMNodeDetailsandTestSCMConfiguration(fail without the fix), plus existing OM and SCM HA unit tests.ozone-hacompose cluster on an IPv6 only network with static IP literals in the OM and SCM addresses: SCM and OM Ratis rings form on the literal addresses,ozone admin scm transferworks, and the HA acceptance suites pass.🤖 Generated with Claude Code