mirror of
https://github.com/tailscale/tailscale.git
synced 2026-09-15 07:20:36 -04:00
When a node is renamed in the admin console, control sends peers a single MapResponse delta: a PeersChanged entry carrying the full updated node with its new Name, and no new DNSConfig (MagicDNS records are computed client-side from peer names). That arrives as a NodeMutationUpsert, but nodeBackend's upsert path only added the new node's index entries and never removed the replaced node's, so nodeByName retained the old name, and nodeByAddr, nodeByKey, and nodeByStableID could likewise go stale if those fields changed. Since7e609b258the quad-100 resolver serves MagicDNS answers on demand from those live indexes, so a renamed peer's old name kept resolving until something rebuilt the indexes from a full netmap, such as toggling Tailscale off and on. Evict the replaced node's index entries before adding the new ones. Also consolidate the natlab DNS coverage into a single TestMagicDNS that boots one VM and exercises extra records, search domains, and peer add/rename/remove end to end, injecting the same MapResponse shapes that production control sends. Updates tailscale/corp#45631 Change-Id: I8a418317d930ec8ce112f7bd19bfd5778117a65e Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> (cherry picked from commitc0c453334a)