smengcl opened a new pull request, #8850: URL: https://github.com/apache/hadoop/pull/8850
Generated-by: Claude Code (Opus 5.5) ### Description of PR `DatanodeID` builds its address strings with `ipAddr + ":" + port`. For a DataNode with an IPv6 address this gives `2001:db8:0:0:0:0:0:1:9866`, which `NetUtils.createSocketAddr` rejects (`Does not contain a valid host:port authority`). `getXferAddr` is what clients use to connect to DataNodes for reads and writes, so on an IPv6 cluster that uses IP addresses (`dfs.client.use.datanode.hostname=false`, the default) clients cannot reach any DataNode. This is a likely cause of HADOOP-17543. This PR builds the xfer, ipc, info and info secure addresses (both the IP and the host name variants) with `NetUtils.getHostPortString(host, port)`, which brackets IPv6 literals. IPv4 and host name output is unchanged. The NameNode and Router web UIs already split `infoAddr` on `]:`, so they handle the bracketed form. Sub-task of HADOOP-11890. ### How was this patch tested? Added `TestDatanodeID#testAddrStrings`. It checks the exact strings for IPv4, IPv6 and host names, checks that `setIpAddr` rebuilds the cached xfer address, and parses every address back with `NetUtils.createSocketAddr`. It fails on trunk. ### For code changes: - [x] Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')? 🤖 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]
