Skip to content

Commit

Permalink
Remove activationLagThreshold to fix 0->1 scaling (#3482)
Browse files Browse the repository at this point in the history
Signed-off-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Calum Murray <cmurray@redhat.com>
  • Loading branch information
knative-prow-robot and Cali0707 authored Dec 1, 2023
1 parent f6481d7 commit 3076046
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 3076046

Please sign in to comment.