Snapshot Restore That Rolls Back ACLs and Intentions
Fabrikam runs five Consul servers and about 300 client agents. KV holds roughly 200,000 keys for runtime configuration, ACLs are enabled with per-team tokens, and Connect intentions are in use. An OS patch took server s4 offline six days ago and its disk was lost; the remaining four servers are healthy and a leader is elected. On Tuesday an engineer ran a KV cleanup that deleted 4,000 stale keys. On Wednesday the payments team rotated three ACL tokens and added two intentions. On Thursday, with s4's replacement still a week out, someone restored the 36-hour-old snapshot taken before Tuesday's cleanup, using consul snapshot restore against the current leader. Within minutes the payments team was getting 403s, Wednesday's intentions were missing from consul intention list, and the new KV cleanup had reverted.
1. Explain precisely why the rotated tokens and the new intentions vanished, and what the on-call team should do now.
Read the worked answer
consul snapshot restore is a whole-state replacement, not a merge. The snapshot carries KV, the catalog, ACLs (tokens, policies, roles, bindings), intentions, sessions, prepared queries, and coordinate data. Restoring it resets every one of those to the moment the snapshot was taken. That is why three unrelated categories of change - KV cleanup, tokens, intentions - all rolled back together. The 36 hours of work after the snapshot no longer exists anywhere in Consul.
Immediate actions:
- Stop restoring and take a fresh snapshot now so the current (rolled-back but consistent) state is captured before anyone makes further changes.
- Recreate the ACL objects from their source of record - the IdP, Terraform state, or a change ticket. They cannot be recovered from Consul; the SecretIDs of the deleted tokens are gone, so clients holding them must receive new tokens, not re-enable old ones.
- Recreate the two intentions and confirm with
consul intention check -src <source> -dst <dest>that the intended allow/deny result is back, then verify real traffic rather than trusting the list output. - Re-run the KV cleanup after diffing against the pre-restore list, so the 4,000 keys are removed deliberately rather than assumed gone.
The process fix is a snapshot immediately before any bulk mutation, plus a rule that ACL and intention changes are recorded outside Consul so they can be replayed when a restore regresses them.
2. The cluster has four live servers and one dead one. What is the correct way to return to five healthy voting servers, and what will happen on its own?
Read the worked answer
Four of five servers are live, so quorum (3) is intact and the cluster can serve reads and writes - this is a capacity and resilience problem, not an outage.
- Autopilot will usually handle the dead peer. With
cleanup_dead_serversenabled (the default) the leader removes peers that have been unreachable past the contact threshold and stabilization window, so s4 should drop out of the Raft peer set without intervention. Confirm withconsul operator raft list-peersandconsul operator autopilot state. - If it does not happen - cleanup disabled, or the dead node was itself the leader in a way that blocked the operation - remove it explicitly:
consul operator raft remove-peer -address=<s4_address>. - Then add the replacement with the same
bootstrap_expectvalue as the rest of the servers, the sameencryptkey, and the sameretry_joinconfiguration, and wait for Autopilot to promote it and reach a healthy five-server state.
Important boundary: the restore did not, and cannot, bring s4 back. Snapshots capture the state machine, not the health or identity of the machines running it. Also note that the sizing argument cuts the other way from the restore: while running on four of five servers, failure tolerance is one server, so the replacement should not be deferred casually.
3. The team wants to rehearse restores monthly. What must they know about the snapshot and the target cluster before doing that?
Read the worked answer
Five properties drive the rehearsal design:
- It clobbers the target. Never rehearse against a cluster that serves traffic. Restore into a scratch cluster sized for the data volume; the restore replays the whole state machine, so the target's existing catalog, KV, and ACLs are overwritten.
- ACL state travels with the data. If the target has ACLs enabled, after the restore you are authenticated against the snapshot's ACL state, not the target's. Keep the source cluster's management token available for the rehearsal or you will restore yourself out of the cluster.
- Version direction is one-way. A snapshot taken by a newer Consul cannot be restored into an older one. Rehearsing an upgrade should include restoring the pre-upgrade snapshot onto the old version, which works; the reverse does not.
- Agent configuration is out of scope. Gossip encryption keys, TLS certificates and CA material, and join configuration live in agent config files, not the snapshot. A restore will not rebuild those, so recovery runbooks must cover them separately.
- Measure the restore, not just its success. Time it against your recovery objective; a 200k-key KV plus a full catalog can take materially longer than a toy cluster, and the number that matters is the one measured on production-sized data.