Siyao Meng created HDDS-15773:
---------------------------------

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


Shared helpers in HddsUtils extract host:port strings by assuming a single 
colon, which corrupts IPv6 literals.

- HddsUtils.getHostName() (HddsUtils.java:202-212) strips a trailing :[0-9]+ 
with a regex. For [::1]:9862 it returns [::1] (brackets left in, DNS lookup 
fails); for a bare ::1:9862 it strips the last segment.
- HddsUtils.format() (HddsUtils.java:579-588) splits Ratis role strings on : 
and indexes fixed positions.

Proposed: route host/port extraction through the existing IPv6-aware paths 
(Guava HostAndPort, already used in HddsUtils.getHostPort(), and Hadoop 
NetUtils), bracketing IPv6 literals when combined with a port. Add unit 
coverage in TestHddsUtils for [::1]:port, bare ::1, and full literal addresses.

Note: NodeDetails.getRatisHostPortStr() Ratis peer-address construction is 
excluded here; it is handled by HDDS-15768.

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