smengcl opened a new pull request, #11656:
URL: https://github.com/apache/ozone/pull/11656

   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), `NodeDetails` builds the Ratis peer address from 
`InetSocketAddress.getHostName()`, which does a reverse DNS lookup and replaces 
the literal with whatever name the resolver returns. Several call sites in 
`OMHANodeDetails`, `OMNodeDetails` and `SCMHANodeDetails` also call 
`getHostName()` before the node details are built, and the lookup result is 
cached in the `InetAddress`, so even `getHostString()` 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 in `notifyInstallSnapshotFromLeader` and `resolveTargetPeerId` 
when the stored address differs from the computed one.
   
   This PR:
   * keeps the configured host string in `NodeDetails` and replaces the 
remaining `getHostName()` calls on the OM and SCM HA address paths with 
`getHostString()`, so the configured literal is used as is;
   * adds `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;
   * uses `isRatisAddress` for SCM leader matching in `SCMStateMachine` and 
`SCMClientProtocolServer`.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17205
   
   ## How was this patch tested?
   
   * New unit tests in `TestOMNodeDetails` and `TestSCMConfiguration` (fail 
without the fix), plus existing OM and SCM HA unit tests.
   * Manually, with the `ozone-ha` compose 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 transfer` works, and the HA acceptance 
suites pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to