FrankChen021 commented on code in PR #19655:
URL: https://github.com/apache/druid/pull/19655#discussion_r3570770878
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:
##########
@@ -207,6 +207,25 @@ public CostBasedAutoScalerConfig getConfig()
return config;
}
+ private boolean isCriticalLag(CostMetrics metrics)
+ {
+ final Long criticalLagThreshold = config.getCriticalLagThreshold();
+ return metrics != null && criticalLagThreshold != null
+ && metrics.getAggregateLag() >= criticalLagThreshold *
WeightedCostFunction.CRITICAL_LAG_TIER1_FRACTION;
Review Comment:
[P2] Use exact total lag for tier checks
`collectMetrics()` supplies only `lagStats.getAvgLag()`, while
`CostMetrics#getAggregateLag()` reconstructs the total as `avgLag *
partitionCount`. `DefaultLagAggregator` computes that average using integer
division, so the reconstructed value can undercount by up to `partitionCount -
1`; for example, total lag 999 across 1000 partitions becomes aggregate lag 0.
A valid `criticalLagThreshold` may therefore be crossed without engaging tier 1
or tier 2. With the updated normal multiplier set to 0, a missed tier also
leaves lag unamplified and scale-up boundaries enabled. Carry
`lagStats.getTotalLag()` into `CostMetrics` and use the exact total for these
comparisons.
--
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]