Copilot commented on code in PR #11272:
URL: https://github.com/apache/ozone/pull/11272#discussion_r4053396510


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -161,12 +162,15 @@ public static String getOmRpcAddress(ConfigurationSource 
conf) {
    * @param conf configuration
    * @param confKey configuration key to lookup address from
    * @return Target InetSocketAddress for the OM RPC server.
+   * @throws ConfigurationException if the configured host cannot be advertised
+   *         to the other OMs of the service
    */
   public static String getOmRpcAddress(ConfigurationSource conf,
       String confKey) {
     final Optional<String> host = getHostNameFromConfigKeys(conf, confKey);
 
     if (host.isPresent()) {
+      validateAdvertisedHost(confKey, host.get());
       return host.get() + ":" + getPortNumberFromConfigKeys(conf, confKey)
               .orElse(OZONE_OM_PORT_DEFAULT);

Review Comment:
   This validates bracketed IPv6 OM peer addresses but still serializes the 
host with `host + ":" + port`. For a valid `[2001:db8::1]` configuration, this 
returns `2001:db8::1:9862`, which Hadoop/RPC parses ambiguously (and can 
address the wrong host/port). Use `getHostPortString(host.get(), port)` here so 
the validation and the emitted HA peer identity agree.



-- 
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]

Reply via email to