Skip to content

operator: Add initial concurrent reconciliation support #724

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

onprem
Copy link
Contributor

@onprem onprem commented Apr 1, 2025

What

This PR adds support for reconciling events concurrently in operator.InformerController. By default only 1 worker would be run, to maintain backward compatibility of processing the events sequentially.

This is done with the help of a new ResourceWatcher implementation called ConcurrentWatcher, which runs multiple workers in the background and shards the incoming events between them. For every event, a hash mod is calculated on the identifier, allowing us to deliver events for same object to the same worker. This is done to maintain the per object in-order guarantee for events by Kubernetes.

Why

This is needed for https://github.com/grafana/cloud-apps-platform/issues/883

@onprem onprem changed the title WIP: operator: Add initial concurrent reconciliation support operator: Add initial concurrent reconciliation support Apr 10, 2025
@onprem onprem marked this pull request as ready for review April 10, 2025 11:11
@onprem onprem requested a review from a team as a code owner April 10, 2025 11:11
@onprem onprem requested a review from IfSentient April 10, 2025 11:11
@onprem onprem force-pushed the prem/concurrent-reconcile branch from 40716b2 to 7c3618e Compare April 10, 2025 11:12
Copy link
Contributor

@IfSentient IfSentient left a comment

Choose a reason for hiding this comment

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

Looks good! Could we add some tests for ConcurrentWatcher since it's in the path for handling all events going forward?

@onprem onprem force-pushed the prem/concurrent-reconcile branch 2 times, most recently from b328b61 to 7cac3dd Compare April 11, 2025 10:15
@onprem
Copy link
Contributor Author

onprem commented Apr 11, 2025

Looks good! Could we add some tests for ConcurrentWatcher since it's in the path for handling all events going forward?

I have added tests for ConcurrentWatcher, and cleaned up a few more things.

@onprem onprem force-pushed the prem/concurrent-reconcile branch 2 times, most recently from 7ac1804 to 7a30859 Compare April 14, 2025 11:13
@onprem onprem force-pushed the prem/concurrent-reconcile branch from 7a30859 to 66683eb Compare April 14, 2025 11:58
@onprem onprem requested a review from IfSentient April 14, 2025 12:09
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