plane
plane copied to clipboard
Fix DNS subject (fixes #265)
Previously, all DNS records for a given cluster went to the same subject. The cli fetches DNS records using DeliverPolicy::LastPerSubject
, so it only gets the last message sent to a subject (so one per cluster). This fixes the issue by adding the backend ID to the subject.
Leaving this as a draft for now because this changes the NATS API between the drone and controller and I haven't thought through a zero-downtime migration path as we try to do for NATS API changes.
Currently, migration requires:
- Re-installing the CLI (
cargo install --path=cli
in root of the repo) - Deleting the old stream (
nats stream delete dns_record
) - Re-building and running the controller and drone (
docker compose build
followed bydocker compose up
)
Stepped deploy approach:
- Deploy controller. The
dns_record_tmp
stream will be created, but messages published will appear on both the newdns_record_tmp
anddns_record
streams. - Drain and redeploy drones. Drones will produce new messages which appear only in the
dns_record_tmp
stream, but this is fine because consumers ofdns_record
have been removed. - Delete the
dns_record
stream in NATS. - In a follow-up PR, change
dns_record_tmp
back todns_record
. - Deploy.
- Delete the
dns_record_tmp
stream in NATS.
I've decided to roll this into the ongoing state machine refactoring work, so I'm going to close this PR.
I've decided to roll this into the ongoing state machine refactoring work, so I'm going to close this PR.