siddhantsangwan commented on a change in pull request #2631:
URL: https://github.com/apache/ozone/pull/2631#discussion_r721339504
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancer.java
##########
@@ -588,15 +594,23 @@ private boolean moveContainer(DatanodeDetails source,
Collection<DatanodeDetails> potentialTargets,
Set<DatanodeDetails> selectedTargets,
ContainerMoveSelection moveSelection, DatanodeDetails source) {
- countDatanodesInvolvedPerIteration += 2;
+ // count source if it has not been involved in move earlier
+ if (!sourceToTargetMap.containsKey(source) &&
+ !selectedTargets.contains(source)) {
+ countDatanodesInvolvedPerIteration += 1;
+ }
+ // count target if it has not been involved in move earlier
+ if (!selectedTargets.contains(moveSelection.getTargetNode())) {
+ countDatanodesInvolvedPerIteration += 1;
+ }
Review comment:
Yes. Counting is performed both during an iteration (to check max
datanodes and size per iteration limits) and at the end of an iteration (to get
correct values once moves have actually been performed).
--
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]