You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/10/06 06:58:21 UTC
[GitHub] [druid] kfaraz commented on a change in pull request #11768: remove useless call to balanceServers
kfaraz commented on a change in pull request #11768:
URL: https://github.com/apache/druid/pull/11768#discussion_r722935109
##########
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:
Would it make sense to add this check inside `balanceServers()` method itself?
It already has a check as follows:
```
if (maxSegmentsToMove <= 0) {
return new Pair<>(0, 0);
}
```
We could add a new else clause `else if (toMoveFrom.isEmpty() || toMoveTo.isEmpty())` to the above `if`.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org