JacksonYao287 commented on a change in pull request #2808:
URL: https://github.com/apache/ozone/pull/2808#discussion_r751146108
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancer.java
##########
@@ -518,14 +475,31 @@ private ContainerMoveSelection matchSourceWithTarget(
}
return null;
}
+
+ //if the utilization of the source data node becomes lower than lowerLimit
+ //after the container is moved out , then the container can not be
+ // a candidate one, and we should remove it from the candidateContainers.
+ candidateContainers.removeIf(c -> {
+ ContainerInfo cInfo;
+ try {
+ cInfo = containerManager.getContainer(c);
+ } catch (ContainerNotFoundException e) {
+ LOG.warn("Could not find container {} when " +
+ "be matched with a move target", c);
+ //remove this not found container
+ return true;
+ }
+ return !findSourceStrategy.canSizeLeaveSource(
+ source, cInfo.getUsedBytes());
+ });
Review comment:
looks good , will do this, thanks!
--
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]