navinko commented on code in PR #10993:
URL: https://github.com/apache/ozone/pull/10993#discussion_r3793707064


##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/SafeModeCheckSubcommand.java:
##########
@@ -193,16 +193,15 @@ private boolean matchesAddress(String address1, String 
address2) {
     }
 
     try {
-      String host1 = HddsUtils.getHostName(address1).orElse(address1);
-      String host2 = HddsUtils.getHostName(address2).orElse(address2);
-
-      boolean hostsMatch = host1.equalsIgnoreCase(host2);
-      if (!hostsMatch) {
-        InetAddress inet1 = InetAddress.getByName(host1);
-        InetAddress inet2 = InetAddress.getByName(host2);
-        hostsMatch = inet1.equals(inet2);
-      }
-      if (!hostsMatch) {
+      // Parse both addresses into host:port components
+      String[] parts1 = address1.split(":", 2);
+      String[] parts2 = address2.split(":", 2);
+
+      String host1 = parts1[0];
+      String host2 = parts2[0];
+
+      // Hostnames must match
+      if (!host1.equalsIgnoreCase(host2)) {

Review Comment:
   I got these unrelated changes post resolving conflict and accepted changes 
from master . 



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