Repository navigation
fix: Retry status write races and skip deleted objects - #1375
Merged
Merged
Conversation
The BGPAdvertisement projection writes NetworkInterface, claim and VPCAttachment status that NSO also writes, from cached copies. A lost race was returned as a reconcile error; requeue instead. A status write to an interface or claim deleted mid-pass is not an error either. A TrafficPolicyBinding often goes with its interface between the read and the status apply. A not-found apply means there is no status to report.
ecv
approved these changes
Nov 6, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
Conflicts requeue through the rate-limited workqueue (bounded backoff, fresh cached read next pass), and NotFound is skipped only on status writes after the object is gone, never on a path that does deletion work.
- No blind overwrite: the writes stay
Status().Updatecarrying the read resourceVersion, so a lost race still returns Conflict and is retried, not forced. The per-attachment loop is idempotent, so re-running after a mid-loop conflict is safe. bgpadvertisement_controller.goskips only on NotFound from a status write (clearWithdrawnAdvertisement, attachment/interface/claim projection). It does not key off DeletionTimestamp, so withdrawal clearing and the APIReader confirmation on the NotFound-at-read path are unchanged. Nothing that must run during deletion is skipped.- #1369 (attachment without a node maps to all tenant advertisements) fans more reconciles at the same attachments, so this conflict path will be hit more often. It stays fine: Conflict is a debug log plus requeue, not an error metric.
reconcilers.go: NotFound on the binding SSA status patch returns nil. Right, since the binding has no status once gone.
Follow-ups:
Requeue: truehas no cap beyond the workqueue's per-item exponential backoff; a persistent conflict (two controllers fighting over a condition) would retry forever at the max delay with only a V(1) log. Consider a counter metric for conflict requeues.- The test covers only the interface-status write; attachment and claim writes share the same handling but have no test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Scot Schuchert-Wells
What
The
bgpadvertisementandtrafficpolicybindingcontrollers in galactic-controller report reconcile errors for races that resolve on their own:These errors keep the reconcile error floor alert firing. They don't point to any real fault.
Change
bgpadvertisement: a conflict now requeues with backoff instead of returning an error. A status write to an interface, claim or attachment that was deleted mid-pass is a no-op.trafficpolicybinding: a not-found status apply means the binding is gone, so the reconcile ends cleanly.Tests cover each case and confirm that other errors still surface. Each new test fails without the fix.
A companion network-services-operator change, datum-cloud/network-services-operator#884, handles the same races on its side.