FrankChen021 commented on code in PR #19655:
URL: https://github.com/apache/druid/pull/19655#discussion_r3520911069
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:
##########
@@ -284,6 +321,12 @@ int computeOptimalTaskCount(CostMetrics metrics)
: startIndex;
}
+ // Emergency (tier 2) lag skips the argmin search entirely: evaluate only
the maximum valid task count.
+ if (emergencyLag) {
+ startIndex = validTaskCounts.length - 1;
Review Comment:
[P1] Make emergency lag choose the max unconditionally
The emergency path narrows the loop to only the maximum valid task count,
but `optimalTaskCount` and `optimalCost` are still initialized from the current
task count before this block. If the configured weights make the current-count
cost lower than the max-count cost, for example `lagWeight=0` and
`idleWeight=1`, the loop evaluates the max candidate but never updates
`optimalTaskCount`, so tier-2 emergency lag returns the current count instead
of jumping to the max. Set the emergency result to the max candidate
unconditionally, or initialize the optimal candidate from `startIndex` after
the emergency bounds are applied.
--
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]