JacksonYao287 commented on a change in pull request #2756:
URL: https://github.com/apache/ozone/pull/2756#discussion_r773837645



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/FindSourceGreedy.java
##########
@@ -100,15 +124,19 @@ public void increaseSizeLeaving(DatanodeDetails dui, long 
size) {
    *
    * @return the nex candidate source data node.
    */
-  @Override
-  public DatanodeDetails getNextCandidateSourceDataNode() {
+  private DatanodeDetails getNextCandidateSourceDataNode() {
     if (potentialSources.isEmpty()) {
       LOG.info("no more candidate source data node");
       return null;
     }
     return potentialSources.poll().getDatanodeDetails();

Review comment:
       @lokeshj1703 @siddhantsangwan 
   ```
     private void incSizeSelectedForMoving(DatanodeDetails source,
                                           ContainerMoveSelection 
moveSelection) {
       ````````
       // update sizeLeavingNode map with the recent moveSelection
       findSourceStrategy.increaseSizeLeaving(source, size);
   
       // update sizeEnteringNode map with the recent moveSelection
       findTargetStrategy.increaseSizeEntering(target, size);
     }
   ```
   ```
    FindSourceGreedy#increaseSizeLeaving
   
     public void increaseSizeLeaving(DatanodeDetails dui, long size) {
       Long currentSize = sizeLeavingNode.get(dui);
       if(currentSize != null) {
         sizeLeavingNode.put(dui, currentSize + size);
         //reorder according to the latest sizeLeavingNode
         potentialSources.add(nodeManager.getUsageInfo(dui));
         return;
       }
       LOG.warn("Cannot find datanode {} in candidate source datanodes",
           dui.getUuid());
     }
   ```
   
   if we can find a target and a container for this source datanode, then 
`incSizeSelectedForMoving` will be definitely called , so this source data node 
will be added back to that priority queue and re-sort again.
   
   if we can not find any target and container for this source datanode , what 
we should do is just removing it. 
   
   so i don`t think this is an issue. does this explanation make sense to you?




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