sreejasahithi commented on code in PR #10993:
URL: https://github.com/apache/ozone/pull/10993#discussion_r3793793012
##########
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:
@navinko I think you might have accepted wrong changes
as this is the latest commit to this particular file
`SafeModeCheckSubcommand.java`
https://github.com/apache/ozone/pull/10831/changes#diff-1ef0fa9c02403bdd29621610c5d5ee82c08a9a2b5dc96de3e738a9568b7feb42L188-R207
Could you please check this out.
--
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]