Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Estimator shows estimated lag but processor is not processing #69

Open
karpikpl opened this issue Jun 13, 2024 · 2 comments
Open

Estimator shows estimated lag but processor is not processing #69

karpikpl opened this issue Jun 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@karpikpl
Copy link

It seems that scaling metric is not precise enough.

Scaler is reporting items to process:

Lease [0] owned by host Instance-cosmosdb-order-processor-585d7b9bc5-gnb88 reports 37 as estimated lag.
Lease [1] owned by host Instance-cosmosdb-order-processor-585d7b9bc5-5jdb2 reports 38 as estimated lag.
There are 2 partitions with estimated lag.

But processor is not getting any items:

k logs cosmosdb-order-processor-585d7b9bc5-gnb88 -n cosmosdb-order-processor
2024-06-13 01:39:00 info: Keda.CosmosDb.Scaler.Demo.OrderProcessor.Worker[0]
      Started change feed processor instance Instance-cosmosdb-order-processor-585d7b9bc5-gnb88
2024-06-13 01:39:00 info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
2024-06-13 01:39:00 info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
2024-06-13 01:39:00 info: Microsoft.Hosting.Lifetime[0]
      Content root path: /app

I verified both are connected to the same DB using a test app that used same client for estimator and feed processor.

Expected Behavior

Pods are scaled to 0 when there's nothing to process.
Pods are processing items when scaler reports estimated changes.

Actual Behavior

Scaler reports changes but processor is not doing anything.

Steps to Reproduce the Problem

  1. Run Demo App on a multi-partition container
  2. Generate some data (may need to do it few times)
  3. Observe the pods

Specifications

@karpikpl karpikpl added the bug Something isn't working label Jun 13, 2024
@JatinSanghvi
Copy link
Collaborator

JatinSanghvi commented Jul 24, 2024

This may have to do more with the order processor not finding any items to process than the scaler reporting incorrect estimated lag. Is it possible that the old processor pod completed processing all changes in its change-feed, then shifted to second change-feed and processed items there too, before KEDA could increase the replica count for order processor? Is the estimate lag not going down to zero, even after giving some time, say 5 minutes or so?

@karpikpl
Copy link
Author

It's been a while, but I remember it did not go to zero even after few hours and restarting processors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants