adoroszlai commented on code in PR #6368:
URL: https://github.com/apache/ozone/pull/6368#discussion_r1544465867


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/NetworkTopologyImpl.java:
##########
@@ -249,7 +250,10 @@ public boolean isSameAncestor(Node node1, Node node2, int 
ancestorGen) {
     }
     netlock.readLock().lock();
     try {
-      return node1.getAncestor(ancestorGen) == node2.getAncestor(ancestorGen);
+      Node ancestor1 = node1.getAncestor(ancestorGen);
+      Node ancestor2 = node2.getAncestor(ancestorGen);
+      return (ancestor1 != null && ancestor1.equals(ancestor2)) ||
+          (ancestor1 == null && ancestor2 == null);

Review Comment:
   ```suggestion
         return Objects.equals(ancestor1, ancestor2);
   ```



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