siddhantsangwan commented on a change in pull request #3129:
URL: https://github.com/apache/ozone/pull/3129#discussion_r813571295
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancer.java
##########
@@ -417,24 +425,32 @@ private IterationResult doIteration() {
findSourceStrategy.removeCandidateSourceDataNode(source);
}
}
-
- if (!isMoveGenerated) {
- //no move option is generated, so the cluster can not be
- //balanced any more, just stop iteration and exit
- return IterationResult.CAN_NOT_BALANCE_ANY_MORE;
- }
- return IterationResult.ITERATION_COMPLETED;
} finally {
- checkIterationMoveResults(selectedTargets);
Review comment:
Yeah, but the original method logic is buggy. I think we can remove the
finally block entirely if we don't return early from the `doIteration` method.
Instead, if we just break out from the while loop and return only at the end
after processing results, we don't need try-finally.
--
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]