Conversation
|
| Status | Scan Engine | Total (0) | ||||
|---|---|---|---|---|---|---|
| Open Source Security | 0 | 0 | 0 | 0 | See details |
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.
|
Thank you for your contribution! 🙏 Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected. While you are waiting, make sure to:
Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient. Learn more about our contribution guide. |
7f94a13 to
14d23dd
Compare
Add github.com/apache/iggy/foreign/go v0.6.0 for the new Apache Iggy scaler. This provides TCP-based client access to Iggy's consumer group offset tracking API. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
Implement a new KEDA scaler for Apache Iggy that autoscales based on consumer group lag over the TCP binary protocol. Includes metadata parsing with validation, GetMetricSpecForScaling, GetMetricsAndActivity with per-partition offset tracking, lag calculation with partition capping, and comprehensive unit tests. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
Allow filtering which partitions are monitored for lag via the partitionLimitation metadata parameter. Supports comma-separated IDs and ranges (e.g., "1,2,3" or "1-4,8,10-12"). Iggy partitions are 1-indexed. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
When enabled, caps the maximum replica count to only the number of partitions that actually have lag > 0, rather than the total partition count. Prevents scaling to unused replicas when most partitions are caught up. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
Track consumer offsets across polling intervals. When a partition's consumer offset hasn't changed since the last check, exclude its lag from the scaling metric while still counting it for activation. This prevents scaling up for stuck consumers where adding replicas won't help. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
Handle new/reset consumer groups gracefully. offsetResetPolicy (earliest/latest, default=latest) controls lag behavior when no committed offset exists. scaleToZeroOnInvalidOffset (default=false) controls whether to scale to zero or keep one replica alive for new consumer groups. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
…fPartitions allowIdleConsumers removes the partition count cap, allowing scaling beyond the number of partitions. ensureEvenDistributionOfPartitions rounds replica count to the nearest factor of total partitions for balanced assignment. Validates that allowIdleConsumers and limitToPartitionsWithLag cannot be set simultaneously. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
- Remove dead earliest branch, document SDK limitation in comment - Fix import ordering to 3-group KEDA convention - Cache Identifier objects on scaler struct to avoid per-poll allocation - Add context cancellation in Close() to stop SDK heartbeat goroutine - Document error handling assumption in GetConsumerOffset - Include consumerGroupId in metric name for uniqueness Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
Signed-off-by: Samuel J. Williams <[email protected]>
End-to-end tests covering earliest/latest offset reset policies, scaleToZeroOnInvalidOffset, excludePersistentLag, limitToPartitionsWithLag, and ensureEvenDistributionOfPartitions. Each scenario uses isolated topics and consumer groups. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
14d23dd to
ae53a22
Compare
Signed-off-by: Samuel J. Williams <[email protected]>
ae53a22 to
7d59037
Compare
Signed-off-by: Rick Brouwer <[email protected]>
c4cd6fa to
c18c700
Compare
| upperBound := totalPartitions | ||
|
|
||
| if ensureEvenDistribution { | ||
| nextFactor := getNextFactorThatBalancesConsumersToTopicPartitions(totalLag, totalPartitions, lagThreshold) |
There was a problem hiding this comment.
Not too sure if this is acceptable or not - the getNextFactorThatBalancesConsumersToTopicPartitions is defined in kafka_scaler.go, so this is adding a dependency to some code in another scaler here?
(I was going to say the same for the offsetResetPolicy type used in the metadata but I just realised that wasn't even used in the end so I'll clean that up.)
Potentially could move this and the FindFactors function to a shared location? If I'm honest I wasn't too sure what to call it so left it where it is but thought I'd mention it in case there was a preference.
Signed-off-by: Samuel J. Williams <[email protected]>
aab7b18 to
61ca517
Compare
…offset unavailable scaleToZeroOnInvalidOffset=true was blindly returning lag=0 when GetConsumerOffset returned nil/error (fresh consumer group), preventing scale-up even with pending messages. Now consults the partition's high watermark from GetTopic() to determine actual lag, matching the approach used by the Kafka scaler's earliest-offset path. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
The v0.7.0 SDK restructures packages (iggycli→client, tcp→client/tcp) and moves the Client interface to contracts. The heartbeat goroutine is now managed internally by the SDK, so Close() replaces manual context cancellation. No user-facing behavioral changes. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Samuel J. Williams <[email protected]>
Signed-off-by: Samuel J. Williams <[email protected]>
Signed-off-by: Samuel J. Williams <[email protected]>
1ac3151 to
7b66680
Compare
Implements an Apache Iggy scaler that autoscales workloads based on consumer group lag. The scaler connects to Iggy over the TCP binary protocol using the official Go SDK (v0.7.0), queries per-partition offsets, and computes lag as
currentOffset - storedOffsetfor each monitored partition.iggycli.NewIggyClientwith a cancellable context to manage the SDK's heartbeat goroutine lifecycle. Identifier objects are cached on the scaler struct to avoid per-poll allocation.partitionCount * lagThresholdby default so desired replicas never exceed partition count, with overrides viaallowIdleConsumers,limitToPartitionsWithLag, andensureEvenDistributionOfPartitions.GetConsumerOffseterrors and nil responses are treated as "no committed offset" — the SDK doesn't expose typed errors to distinguish missing offsets from transient failures. Behavior is controlled byoffsetResetPolicyandscaleToZeroOnInvalidOffset.excludePersistentLagis enabled, the scaler tracksstoredOffsetper partition across polling intervals. Partitions where the consumer offset hasn't changed are excluded from the scaling metric but still count toward activation.Checklist
make generate-scalers-schemahas been run to update any outdated generated filesFixes #7484
Relates to kedacore/keda-docs#1708