Skip to content

fix: Remove a record set's records of other types - #258

Merged
vvoytovych merged 1 commit into
mainfrom
fix/type-change-removes-old-record
Oct 20, 2026
Merged

vvoytovych merged 1 commit into
mainfrom
fix/type-change-removes-old-record

Conversation

@vvoytovych

Copy link
Copy Markdown
Contributor

A record set that changes type keeps its old record in PowerDNS. When an ALIAS becomes a CNAME, the old ALIAS blocks the new CNAME, and the record set reports a conflict with itself. Deleting the record set leaves the old record behind.

This removes every record a record set wrote and no longer wants, whatever its type.

Change Effect
Update and delete remove the record set's own records of every type, not only of its current type a record set that changes type publishes with no manual step, and a deleted record set leaves nothing behind
The old record's delete travels in the same request as the new record, ahead of it if PowerDNS refuses the new record, nothing changes and the old record keeps serving
A conflict message names only records that the record set did not write the message points at the record that blocks
The agent logs and counts each record of another type that it deletes a rollout shows what it removed
  • Records that another record set wrote, and records that nothing wrote, stay untouched.
  • A record set that is already programmed does not reach PowerDNS again until its generation changes, and a resync does not reach it either, so its old records of another type go on its next change or delete. A record set that is not programmed, such as one in conflict with its own old record, reconciles at once on upgrade. A controller comment said a resync corrects drift; it now says that it does not.
  • The issue says production is not affected. One production record set is: a test wildcard in our own project conflicts with its own old ALIAS. It clears with this release.
  • Use CNAME routing records for non-apex hostnames network-services-operator#564 would convert non-apex ALIAS records to CNAME and meet this on each one.

Test plan

  • Locally, on PowerDNS 5.1.4 with LMDB: ALIAS to CNAME and back at one name, each in one request, and a second reconcile sends nothing
  • Locally: other record sets' records and unowned records survive a type change and a delete, the apex keeps its SOA and NS, and a refused change keeps the old record serving until the blocker is gone
  • Eight planted defects each fail a test
  • CI passes on this branch

Fixes #225

A record set that changed type kept its old records in PowerDNS. The
agent pruned only records of the set's current type, so an ALIAS that
became a CNAME conflicted with its own old ALIAS, and deleting the set
left the old record behind.

The agent now deletes every record that the set's ownership note names
and that the set no longer wants, whatever its type. A delete at a name
the set rewrites travels in the same PATCH, ahead of the rewrite, so a
refused rewrite rolls back and the old record keeps serving. A conflict
message no longer names the set's own old record. The agent logs and
counts each record of another type that it deletes.

The record set controller's comment said a resync corrects drift. A
resync stops at the same programmed-at-generation check, so it does
not, and the comment now says so.

Fixes #225
@vvoytovych
vvoytovych marked this pull request as ready for review October 20, 2026 16:41
@vvoytovych
vvoytovych requested a review from a team as a code owner October 20, 2026 16:41
@vvoytovych
vvoytovych merged commit 3b5a2ea into main Oct 20, 2026
12 checks passed
@vvoytovych
vvoytovych deleted the fix/type-change-removes-old-record branch October 20, 2026 17:44
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.

Changing a record's type leaves the old record behind and blocks the new one

2 participants