docs(spec): Plan 2 — control-plane resolver adoption (drop IP pinning) #166

Open
charles wants to merge 0 commits from design/control-plane-resolver-adoption into main
Owner

Plan 2 design spec: make the control-plane consumers resolver-aware so we can drop IP pinning on db1 + the coordinator.

Plan 1's resolver is deployed but only ~20% adopted — only the member agent uses it. The coordinator pgbouncer (caches db1 IP), nginx (stored coordinator IP), the WG endpoint advertisement, and unmanaged-DB resolvability all still consume raw/stale IPs. Those are exactly the paths that broke during the live migration when db1 moved.

Four independently-deployable workstreams: W1 pgbouncer re-resolve, W2 nginx resolver-aware, W3 WG advertisement auto-reconcile, W4 publish DBs by identity. Open decision: coordinator↔db co-location (drives W1 approach).

🤖 Generated with Claude Code

Plan 2 design spec: make the control-plane consumers resolver-aware so we can drop IP pinning on db1 + the coordinator. Plan 1's resolver is deployed but only ~20% adopted — only the member agent uses it. The coordinator pgbouncer (caches db1 IP), nginx (stored coordinator IP), the WG endpoint advertisement, and unmanaged-DB resolvability all still consume raw/stale IPs. Those are exactly the paths that broke during the live migration when db1 moved. Four independently-deployable workstreams: W1 pgbouncer re-resolve, W2 nginx resolver-aware, W3 WG advertisement auto-reconcile, W4 publish DBs by identity. Open decision: coordinator↔db co-location (drives W1 approach). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Plan 1's resolver is deployed but only ~20% adopted: only the member agent's
endpoint refresh uses it. The coordinator's pgbouncer (caches db1 IP), nginx
(stored coordinator IP), the WG endpoint advertisement, and unmanaged database
resolvability all still consume raw/stale IPs — which is why db1/coordinator
are still pinned and why the live migration incident cascaded when db1 moved.

Spec scopes four independently-deployable workstreams (pgbouncer re-resolve,
nginx resolver-aware, WG advertisement reconcile, database identity publish)
that let us un-pin db1 and the coordinator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EPmYfmPxMNCcd47mNUPmH9
Sidecar reports its actual wg0 listen-port on the existing container-state POST;
the API reconciles mesh_hosts.wireguard_endpoint against it each tick, so port
drift (e.g. from a stale wireguard.env re-read on db1 boot) self-heals in ~25s.
4 TDD tasks. First of the four Plan-2 workstreams (rollout order W3→W1→W4→W2).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EPmYfmPxMNCcd47mNUPmH9
Wires W3 Task 4: extend containerStateReportSchema with optional
wg_listen_port, select the host row's current wireguard_endpoint after
persisting actual_container_state, and apply reconcileWgEndpointPort to
auto-correct the DB when the sidecar reports a different actual port.
No-ops when equal or when wg_listen_port is absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EPmYfmPxMNCcd47mNUPmH9
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin design/control-plane-resolver-adoption:design/control-plane-resolver-adoption
git switch design/control-plane-resolver-adoption

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff design/control-plane-resolver-adoption
git switch design/control-plane-resolver-adoption
git rebase main
git switch main
git merge --ff-only design/control-plane-resolver-adoption
git switch design/control-plane-resolver-adoption
git rebase main
git switch main
git merge --no-ff design/control-plane-resolver-adoption
git switch main
git merge --squash design/control-plane-resolver-adoption
git switch main
git merge --ff-only design/control-plane-resolver-adoption
git switch main
git merge design/control-plane-resolver-adoption
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/projectoctet!166
No description provided.