Skip to content

Commit

Permalink
Remove activationLagThreshold to fix 0->1 scaling (knative-extensions…
Browse files Browse the repository at this point in the history
…#3479) (#902)

Signed-off-by: Calum Murray <[email protected]>
  • Loading branch information
Cali0707 authored Dec 5, 2023
1 parent 8d29ba1 commit 3c603de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion control-plane/pkg/autoscaler/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func defaultConfig() *AutoscalerConfig {
AutoscalingPollingIntervalAnnotation: DefaultPollingInterval,
AutoscalingCooldownPeriodAnnotation: DefaultCooldownPeriod,
AutoscalingLagThreshold: DefaultLagThreshold,
AutoscalingActivationLagThreshold: DefaultActivationLagThreshold,
},
}
}
Expand Down
16 changes: 5 additions & 11 deletions control-plane/pkg/autoscaler/keda/keda.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,18 @@ func GenerateScaleTriggers(cg *kafkainternals.ConsumerGroup, triggerAuthenticati
return nil, err
}

activationLagThreshold, err := GetInt32ValueFromMap(cg.Annotations, autoscaler.AutoscalingActivationLagThreshold, aconfig.AutoscalerDefaults[autoscaler.AutoscalingActivationLagThreshold])
if err != nil {
return nil, err
}

allowIdleConsumers := "false"
if cg.Status.Placements != nil {
allowIdleConsumers = "true"
}

for _, topic := range cg.Spec.Template.Spec.Topics {
triggerMetadata := map[string]string{
"bootstrapServers": bootstrapServers,
"consumerGroup": consumerGroup,
"topic": topic,
"lagThreshold": strconv.Itoa(int(*lagThreshold)),
"activationLagThreshold": strconv.Itoa(int(*activationLagThreshold)),
"allowIdleConsumers": allowIdleConsumers,
"bootstrapServers": bootstrapServers,
"consumerGroup": consumerGroup,
"topic": topic,
"lagThreshold": strconv.Itoa(int(*lagThreshold)),
"allowIdleConsumers": allowIdleConsumers,
}

trigger := kedav1alpha1.ScaleTriggers{
Expand Down

0 comments on commit 3c603de

Please sign in to comment.