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(service-mirror): don't restart cluster watch upon Link status updates #13579

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

alpeb
Copy link
Member

@alpeb alpeb commented Jan 20, 2025

Every time there's an update to a Link resource the service mirror restarts the cluster watch after cleaning up any existing worker. We recently introduced a status stanza in Link that gets updated upon every mirroring of a service, which was unnecessarily triggering a cluster watcher restart. For a sufficiently high number of services getting mirrored at once this was causing severe contention on the controller, delaying mirroring up to a halt.

This change fixes the situation by only considering changes in the Link Spec for restarting the cluster watch.

…ates

Every time there's an update to a Link resource the service mirror restarts the cluster watch after cleaning up any existing worker. We recently introduced a status stanza in Link that gets updated upon every mirroring of a service, which was unnecessarily triggering a cluster watcher restart. For a sufficiently high number of services getting mirrored at once this was causing severe contention on the controller, delaying mirroring up to a halt.

This change fixes the situation by only considering changes in the Link Spec for restarting the cluster watch.
@alpeb alpeb requested a review from a team as a code owner January 20, 2025 21:43
Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

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

What would it take to make this testable?

Could the handler be pulled out of main.go into library code (i.e. in a setup commit)?

multicluster/cmd/service-mirror/main.go Outdated Show resolved Hide resolved
multicluster/cmd/service-mirror/main.go Outdated Show resolved Hide resolved
@alpeb alpeb force-pushed the alpeb/service-mirror-ignore-status-updates branch from 4499f7d to d0f85c4 Compare January 22, 2025 16:33
…d add unit test making sure the add/update/delete functions are called, and that in particular the update function is _not_ called when updating a Link status.
@alpeb alpeb merged commit a726757 into main Jan 22, 2025
40 checks passed
@alpeb alpeb deleted the alpeb/service-mirror-ignore-status-updates branch January 22, 2025 17:35
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