Siyao Meng created HDDS-16831:
---------------------------------

             Summary: Make remaining host and port concatenations IPv6-safe
                 Key: HDDS-16831
                 URL: https://issues.apache.org/jira/browse/HDDS-16831
             Project: Apache Ozone
          Issue Type: Task
            Reporter: Siyao Meng


Several production code paths still build an endpoint with {{host + ":" + 
port}}. With an IPv6 literal this produces an ambiguous value such as 
{{2001:db8::10:9862}}, which is then parsed incorrectly or rejected.

Affected call sites:
* {{DiskBalancerSubCommandUtil.getClientRpcAddress}}: joins the datanode IP 
address and port, then passes the result to {{NetUtils.createSocketAddr}}. 
{{ozone admin datanode diskbalancer}} fails for any datanode with an IPv6 
address.
* {{ReconfigureSubCommandUtil}}: same pattern when building the datanode 
address list for batch {{ozone admin reconfig}}.
* {{GrpcOMFailoverProxyProvider}}: joins the OM host and the gRPC port. The 
result is parsed by {{NetUtils.createSocketAddr}} in {{OMProxyInfo}} and by 
{{HostAndPort.fromString}} in {{GrpcOmTransport}}.
* {{BaseInsightSubCommand.getHost}}: builds the HTTP URL for {{ozone insight}} 
from a datanode hostname and port without brackets.
* {{DiskBalancerSubCommandUtil.getDatanodeHostAndIp}}: display only, but prints 
an ambiguous address in status and report output.

The two admin CLI paths use the datanode IP address, so they are affected even 
when the cluster is configured with DNS names.

Requirements:
* Use {{HddsUtils.getHostPortString}} (HDDS-15773) at these call sites so that 
IPv6 literals are bracketed.
* Keep DNS and IPv4 behavior and output unchanged.
* Add unit tests with an IPv6 literal for each changed path.

Parent epic: HDDS-15763.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to