capistrant commented on a change in pull request #11768:
URL: https://github.com/apache/druid/pull/11768#discussion_r723369370



##########
File path: 
server/src/main/java/org/apache/druid/server/coordinator/duty/BalanceSegments.java
##########
@@ -144,16 +144,21 @@ private void balanceTier(
     }
 
     final int maxSegmentsToMove = 
Math.min(params.getCoordinatorDynamicConfig().getMaxSegmentsToMove(), 
numSegments);
-    int decommissioningMaxPercentOfMaxSegmentsToMove =
-        
params.getCoordinatorDynamicConfig().getDecommissioningMaxPercentOfMaxSegmentsToMove();
-    int maxSegmentsToMoveFromDecommissioningNodes =
-        (int) Math.ceil(maxSegmentsToMove * 
(decommissioningMaxPercentOfMaxSegmentsToMove / 100.0));
-    log.info(
-        "Processing %d segments for moving from decommissioning servers",
-        maxSegmentsToMoveFromDecommissioningNodes
-    );
-    Pair<Integer, Integer> decommissioningResult =
-        balanceServers(params, decommissioningServers, activeServers, 
maxSegmentsToMoveFromDecommissioningNodes);
+
+    // Only do the work of calling balanceServers to move from decomissioning 
servers if there are > 0 decomissioning servers
+    Pair<Integer, Integer> decommissioningResult = new Pair<>(0, 0);
+    if (!decommissioningServers.isEmpty()) {

Review comment:
       hmm, I guess I am indifferent. But I'd also pose the question as to why 
balanceServers is even called here when segments to move was calculated to be 0 
before the call. I guess it is kind of a programmers preferred style. Leaving 
the argument checks to the method being called instead of the code calling. I 
think I'm fine with changing it to match existing style. I will try to get it 
done sometime today. Thanks for taking a look!




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