FrankChen021 commented on code in PR #19641:
URL: https://github.com/apache/druid/pull/19641#discussion_r3499356824
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScalerConfig.java:
##########
@@ -94,27 +86,15 @@ public CostBasedAutoScalerConfig(
@Nullable @JsonProperty("usePollIdleRatio") Boolean usePollIdleRatio
)
{
- this.enableTaskAutoScaler = enableTaskAutoScaler != null ?
enableTaskAutoScaler : false;
-
- // Timing configuration with defaults
- this.scaleActionPeriodMillis = scaleActionPeriodMillis != null
- ? scaleActionPeriodMillis
- : DEFAULT_SCALE_ACTION_PERIOD_MILLIS;
- this.minTriggerScaleActionFrequencyMillis = Configs.valueOrDefault(
- minTriggerScaleActionFrequencyMillis,
- DEFAULT_SCALE_ACTION_PERIOD_MILLIS
- );
+ this.enableTaskAutoScaler = Configs.valueOrDefault(enableTaskAutoScaler,
false);
+ this.scaleActionPeriodMillis =
Configs.valueOrDefault(scaleActionPeriodMillis,
DEFAULT_MIN_SCALE_UP_DELAY.getMillis());
- // Cost function weights with defaults
this.lagWeight = Configs.valueOrDefault(lagWeight, DEFAULT_LAG_WEIGHT);
this.idleWeight = Configs.valueOrDefault(idleWeight, DEFAULT_IDLE_WEIGHT);
this.useTaskCountBoundariesOnScaleUp =
Configs.valueOrDefault(useTaskCountBoundariesOnScaleUp, false);
this.useTaskCountBoundariesOnScaleDown =
Configs.valueOrDefault(useTaskCountBoundariesOnScaleDown, true);
- this.minScaleUpDelay = Configs.valueOrDefault(
- minScaleUpDelay,
- Duration.millis(this.minTriggerScaleActionFrequencyMillis)
- );
- this.minScaleDownDelay = Configs.valueOrDefault(minScaleDownDelay,
DEFAULT_MIN_SCALE_DELAY);
+ this.minScaleUpDelay = Configs.valueOrDefault(minScaleUpDelay,
DEFAULT_MIN_SCALE_UP_DELAY);
Review Comment:
[P2] Preserve the legacy cooldown fallback
Existing cost-based supervisor specs can still contain
`minTriggerScaleActionFrequencyMillis`, and the shared `AutoScalerConfig`
contract/docs say `minScaleUpDelay` and `minScaleDownDelay` fall back to it
when the Duration fields are absent. This PR removes the creator parameter and
always defaults `minScaleUpDelay` to `DEFAULT_MIN_SCALE_UP_DELAY`, while the
getter now returns `-1`, so a persisted spec that only set the deprecated field
is accepted but silently changes its scale-up cooldown on upgrade. Please
continue binding the legacy value and using it as the fallback until the field
is actually removed, or migrate the public contract/docs and persisted-spec
behavior together.
--
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]