You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/02/24 06:04:01 UTC

[GitHub] [ozone] siddhantsangwan commented on a change in pull request #3129: HDDS-6367. ContainerBalancer shows incorrect iteration result sometimes

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. If we have instead 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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org