plane icon indicating copy to clipboard operation
plane copied to clipboard

Fix DNS subject (fixes #265)

Open paulgb opened this issue 2 years ago • 1 comments

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 by docker compose up)

paulgb avatar Nov 22 '22 15:11 paulgb

Stepped deploy approach:

  • Deploy controller. The dns_record_tmp stream will be created, but messages published will appear on both the new dns_record_tmp and dns_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 of dns_record have been removed.
  • Delete the dns_record stream in NATS.
  • In a follow-up PR, change dns_record_tmp back to dns_record.
  • Deploy.
  • Delete the dns_record_tmp stream in NATS.

paulgb avatar Nov 23 '22 15:11 paulgb

I've decided to roll this into the ongoing state machine refactoring work, so I'm going to close this PR.

paulgb avatar Nov 29 '22 14:11 paulgb

I've decided to roll this into the ongoing state machine refactoring work, so I'm going to close this PR.

paulgb avatar Nov 29 '22 14:11 paulgb