superdiaodiao commented on code in PR #43978:
URL: https://github.com/apache/doris/pull/43978#discussion_r1842131841


##########
fe/fe-core/src/main/java/org/apache/doris/common/proc/FrontendsProcNode.java:
##########
@@ -214,10 +214,27 @@ private static boolean isJoin(List<InetSocketAddress> 
allFeHosts, Frontend fe) {
                 LOG.warn("Failed to get InetAddress {}", addr);
                 continue;
             }
-            if (fe.getHost().equals(address.getHostAddress())) {
+            // Format the IP address
+            String formattedIp = formatIp(address.getHostAddress());
+
+            if (fe.getHost().equals(formattedIp)) {
                 return true;
             }
         }
         return false;
     }
+
+    private static String formatIp(String context) {
+        // Formatting rule 1: Replace ":0:" with "::"
+        while (context.contains(":0:")) {
+            context = context.replaceAll(":0:", "::");
+        }
+
+        // Formatting rule 2: Replace ":::" with "::"
+        while (context.contains(":::")) {
+            context = context.replaceAll(":::", "::");
+        }

Review Comment:
   IPv6 address has two `:` at most.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to