Fix authoritative secondary replication (TSIG transfer + stable primary) #9
Reference in New Issue
Block a user
Delete Branch "benvin/fix-secondary-replication"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Replication to the authoritative secondaries never worked — the secondaries carried only 2 zones vs the master's 20, so the
.6read Service has been answering purely from the master (pod-0 is in its selector). Diagnosed on-cluster: the master REFUSES the catalog AXFR.Three bugs in the transfer path:
allow-transfer { key "transfer-key"; }, but the rendered secondary config transfers unkeyed (default-primaries { <ip>; }) → REFUSED → no catalog → no member zones.allow-transfer. e.g.main.unkin.netonly hadallow-update, so even once the catalog transfers, members couldn't be pulled.Changes
catalog-zonesdefault-primaries and the secondary catalog zoneprimaries(<ip> key "transfer-key"), so key-authenticated AXFR is accepted.allow-transfer { key "<transfer-key>"; }to catalog member primary zones when no explicitallow-transferis set; applied to existing zones viamodzoneon reconcile.Tests
TestRenderCatalogPrimariesCarryTransferKeyasserts the key appears in both secondary catalog clauses; existing catalog/keyless tests still pass.go build/vet/testclean.Deploy note
Needs a version bump + redeploy; folding the image/CRD bump into the in-flight argocd PR. Once the new operator reconciles, existing member zones get
allow-transferviamodzoneand secondaries re-point at the ClusterIP with the key, restoring replication.Secondaries never replicated any member zone: the master's catalog zone requires key-authenticated AXFR (allow-transfer { key "transfer-key"; }), but the rendered secondary config transferred without presenting the key, so every catalog transfer was REFUSED and no member zones provisioned. Two further gaps compounded it: member zones had no allow-transfer at all, and secondaries pointed at the primary's pod IP, which dies on restart. - Render the catalog transfer key into the secondary catalog-zones default-primaries and the secondary catalog zone primaries, so key-authenticated AXFR from the primary is accepted. - Add allow-transfer { key "<transfer-key>"; } to catalog member primary zones (when the zone does not set an explicit allow-transfer), so secondaries can pull them; applied to existing zones via modzone. - Point secondaries at the stable primary Service ClusterIP instead of the primary pod IP, so replication survives primary pod restarts (falls back to the pod IP when no primary Service exists).