anton-vinogradov commented on code in PR #12517:
URL: https://github.com/apache/ignite/pull/12517#discussion_r2721233558


##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNodesRing.java:
##########
@@ -506,7 +506,10 @@ public void clear() {
             if (filtered.size() < 2)
                 return null;
 
-            Iterator<TcpDiscoveryNode> iter = filtered.iterator();
+            NavigableSet<TcpDiscoveryNode> sorted = new TreeSet<>(new 
MdcAwareNodesComparator());
+            sorted.addAll(filtered);

Review Comment:
   MdcAwareNodesComparator guarantee elements to be non-equals since it 
compares dcId and if they are equal it compares nodes as usual.
   
   ```
   if (res == 0)
      res = n1.compareTo(n2);
   ```



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

Reply via email to