Skip to content

fix: Stop zone discovery from re-reconciling its own status - #139

Draft
ecv wants to merge 2 commits into
mainfrom
fix/discovery-reconcile-churn
Draft

ecv wants to merge 2 commits into
mainfrom
fix/discovery-reconcile-churn

Conversation

@ecv

@ecv ecv commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Zone discovery kept waking itself up, because every status write on a discovery object came back through its own watch and bought a reconcile that could only read the object and return.

The watch now ignores updates that touch only status, and the one step that edits metadata rather than spec asks for its own retry, since its event gets filtered too.

The zone and record set replicators keep their unfiltered watch on purpose, so new tests pin the guarantee that makes it safe, that re-entering a converged reconcile writes nothing.

Supersedes #33.

Test plan

  • A settled discovery object stops reconciling once its records are published
  • A converged zone writes nothing to either control plane
  • Zone and record provisioning still works end to end
  • Build, lint and unit tests pass

https://claude.ai/code/session_018tBsAgdCCzyooXjz2Dh9xp

zachsmith1 and others added 2 commits September 4, 2026 13:47
Status patches on a DNSZoneDiscovery bounced back through the For() watch
and re-enqueued the reconciler, because nothing filtered status-only
updates, which do not bump metadata.generation. Every condition write on
the object bought at least one wasted reconcile that could only read the
object and return.

Gate the watch on GenerationChangedPredicate so only real spec changes
re-enqueue. The owner-reference patch is metadata-only and now needs an
explicit requeue, since the watch event it raises is filtered too.

Add status idempotency tests covering the zone and recordset
replicators, proving updateStatus and the ensureDownstream helpers issue
no writes once converged. Those replicators keep their unfiltered For()
watch, so the re-enqueue after a status mirror must land on a read-only
reconcile rather than a write loop.

Claude-Session: https://claude.ai/code/session_018tBsAgdCCzyooXjz2Dh9xp
The ported steady-state check ran the helper sequence the zone reconcile
used in March. Trunk has since put a domain ownership gate in front of
provisioning and publishes the zone's domain link ahead of it, so the
test converged a zone by a route the controller no longer takes and
never touched either new step.

Reorder the walk to the sequence Reconcile runs today, add the domain
link and verification gate to it, and mark the fixture Domain verified
so the walk reaches provisioning at all.

Claude-Session: https://claude.ai/code/session_018tBsAgdCCzyooXjz2Dh9xp
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