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


##########
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:
   Thanks @sreejasahithi for review , Ideally once we resolve the conflict we 
shud accept the changes coming from master . I also did the same , But instead 
of rebasing on master and resolving locally, used a shortcut and resolved the 
conflict in the GitHub UI , that merged master's changes to 
SafeModeCheckSubcommand.java into my diff and caused the unrelated changes. 
I've now rebased properly on the latest master and addressed the review 
comments. The PR now contains only the safe-mode changes and is List-based 
end-to-end, with no conflicts.
   
   CI Build already triggered , will monitor and mark the PR for review.
   
   



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