siddhantsangwan commented on code in PR #6305:
URL: https://github.com/apache/ozone/pull/6305#discussion_r1522726768


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/FindSourceGreedy.java:
##########
@@ -138,6 +138,11 @@ public void removeCandidateSourceDataNode(DatanodeDetails 
dui) {
     potentialSources.removeIf(a -> a.getDatanodeDetails().equals(dui));
   }
 
+  @Override
+  public void addBackSourceDataNode(DatanodeDetails dui) {
+    potentialSources.add(nodeManager.getUsageInfo(dui));
+  }

Review Comment:
   A caller could use this method to a Datanode that wasn't previously removed 
from the priority queue. This could result in multiple instances of the same 
Datanode in the queue. Let's add a javadoc to the interface and explicitly call 
out that anyone using this method should ensure the Datanode was previously 
removed or that it isn't present in the queue.



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