jojochuang commented on code in PR #11656:
URL: https://github.com/apache/ozone/pull/11656#discussion_r4394959788
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/NodeDetails.java:
##########
@@ -45,7 +45,8 @@ public NodeDetails(String serviceId, String nodeId,
this.nodeId = nodeId;
this.rpcAddress = rpcAddress;
if (rpcAddress != null) {
- this.hostAddress = rpcAddress.getHostName();
+ // Keep the configured host. getHostName() would replace an IP literal
with its reverse DNS name.
+ this.hostAddress = rpcAddress.getHostString();
Review Comment:
[P2] Preserve the configured literal before flexible FQDN resolution runs
When `ozone.network.flexible.fqdn.resolution.enabled=true`, both
`OMHANodeDetails.loadOMHAConfig()` and `SCMHANodeDetails.loadSCMHAConfig()`
call `OzoneNetUtils.isUnresolved()` before constructing the node details. That
calls `isAddressHostNameLocal()`, which invokes `addr.getHostName()` and caches
the reverse DNS name. Consequently, `getHostString()` here can already return
the resolved hostname, and the invalid Ratis peer address problem remains for
this configuration. I confirmed the caching behavior on JDK 21: an
`InetSocketAddress` created with `127.0.0.1` returns `localhost` from
`getHostString()` after `getHostName()` is called. Could we preserve the
configured host before these checks and add a regression test with flexible
FQDN resolution enabled? The added tests currently exercise the default
(`false`) setting.
--
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]