Skip to content

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)?

@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.

3 participants