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

Fix scaling for empty lease. #888

Merged
merged 4 commits into from
Apr 9, 2024
Merged

Fix scaling for empty lease. #888

merged 4 commits into from
Apr 9, 2024

Conversation

alrod
Copy link
Member

@alrod alrod commented Apr 8, 2024

CosmosDb trigger need at least one execution to initiate correct lease/checkpoint,

actually it works, we just missing a document in the beginning:

  1. FunctionApp is deployed, no assigned workers.
  2. SC handles "Non Found" - SC detect empty leases and add a new worker -> worker creates leases container and "ContinuationToken": null doc.
  3. SC votes for 0 workers as Delta = 0.
  4. Add a doc1 -> SC always votes for 1 worker as Delta = 1. We always have 1 assigned worker.
  5. Add doc2 -> triggers executes on doc2 as we have an active worker - proper lease doc is created. The trigger executes fine from this point of time.
    doc1 has never triggered.

Copy link
Member

@ealsur ealsur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding tests to cover the new behavior

@alrod alrod merged commit 83da486 into dev Apr 9, 2024
7 checks passed
@alrod alrod deleted the user/alrod/fix-scale branch April 9, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants