Fly-Style commented on code in PR #18958:
URL: https://github.com/apache/druid/pull/18958#discussion_r2734996454
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:
##########
@@ -157,11 +164,17 @@ public int computeTaskCountForScaleAction()
final int optimalTaskCount = computeOptimalTaskCount(lastKnownMetrics);
final int currentTaskCount = lastKnownMetrics.getCurrentTaskCount();
- // Perform only scale-up actions
+ // Perform scale-up actions; scale-down actions only if configured.
int taskCount = -1;
if (optimalTaskCount > currentTaskCount) {
taskCount = optimalTaskCount;
- log.info("New task count [%d] on supervisor [%s]", taskCount,
supervisorId);
+ scaleDownCounter = 0; // Nullify the scaleDown counter after a
successful scaleup too.
+ log.info("New task count [%d] on supervisor [%s], scaling up",
taskCount, supervisorId);
+ } else if (!config.isScaleDownOnTaskRolloverOnly() && optimalTaskCount <
currentTaskCount &&
+ (config.getScaleDownBarrier() == 0 || ++scaleDownCounter ==
config.getScaleDownBarrier())) {
Review Comment:
Yep, good catch!
--
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]