smengcl opened a new pull request, #11619: URL: https://github.com/apache/ozone/pull/11619
Generated-by: Claude Code (Opus 5.5) ## What changes were proposed in this pull request? Several production paths pass a host that can be a bare IPv6 literal to `NetUtils.createSocketAddr(target, defaultPort)`, or format it into a URL without brackets. Hadoop parses `target` as a URI authority, so a bare literal such as `2001:db8::10` throws `IllegalArgumentException: Does not contain a valid host:port authority`. Bare literals reach these paths because SCM records a datanode's IP with `InetAddress.getHostAddress()` (and its hostname is the literal when there is no reverse DNS), and `NodeDetails` takes its host address from `InetSocketAddress.getHostName()`. Affected paths: - `NodeDetails.getRpcAddress()`: OM bootstrap (`checkRemoteOMConfig`, `addOMToRatisRing`) throws when the remote OM's host address is a bare literal. - `SCMHANodeDetails.loadSCMHAConfig`: SCM HA fails to start with an unbracketed `ozone.scm.address.<serviceId>.<nodeId>`, although `validateAdvertisedHost` accepts it. - `XceiverClientManager.getPipelineCacheKey` and `XceiverClientShortCircuit`: with short circuit reads enabled, every non EC read from an IPv6 datanode fails. - `DataNodeMetricsCollectionTask` (Recon): the datanode JMX URL is malformed, so pending deletion metrics are reported as -1. - `DiskBalancerSubCommandUtil.getSingleNodeDiskBalancerProxy`: any `:` was taken to mean "port given", so `[2001:db8::1]` and `2001:db8::1` threw instead of using the default port. - `ozone local`: with `--host ::1`, service addresses, the Recon endpoint and the startup summary became `::1:9860`. The fix combines host and port with `HddsUtils.getHostPortString`, and parses the DiskBalancer and SCM HA addresses with `HddsUtils.getHostName` / `getHostPort`. These bracket IPv6 literals and accept DNS names, IPv4 literals and already bracketed input. This follows the same pattern as HDDS-15773 and HDDS-16831. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17135 ## How was this patch tested? New unit tests. The bare IPv6 cases fail without the fix; the DNS, IPv4 and bracketed cases guard against regressions: - `TestOMNodeDetails`: unbracketed IPv6 host address. - `TestSCMConfiguration`: SCM HA peer with unbracketed and bracketed IPv6 address. - `TestDataNodeMetricsCollectionTask` (new): JMX URL for a DNS name and an IPv6 literal over HTTP and HTTPS. - `TestDiskBalancerSubCommandUtil`: address parsing for IPv4, bare IPv6 and bracketed IPv6, with and without a port. - `TestLocalOzoneCluster` and `TestOzoneLocal`: service addresses, Recon endpoint and startup summary with `--host ::1`. 🤖 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]
