{"id":"a43021ed-e903-4fa4-987c-1fd8f27f7693","task":"Perform a planned Postgres leader change with patronictl switchover instead of triggering a failover","domain":"patroni.readthedocs.io","steps":["Confirm the cluster is healthy (patronictl list shows all nodes running and streaming), since switchover is only permitted on a healthy cluster","Run patronictl switchover, optionally specifying the leader, --candidate, and --scheduled <timestamp> for a deferred switch","Patroni pauses writes on the current leader, waits for the candidate to catch up on WAL, then promotes it and demotes the old leader to a replica","Verify the new leader with patronictl list and confirm application traffic (via HAProxy/PgBouncer/DNS) follows the leader role rather than a fixed node","Reserve patronictl failover for emergencies (no healthy leader) — it skips the health precondition switchover enforces"],"gotchas":["switchover refuses to run if the cluster is unhealthy or the target candidate isn't caught up on WAL; use failover for those cases instead","A scheduled switchover can be cancelled before it runs, but not once Patroni begins the actual promotion sequence","Client connection routing must be tied to the Patroni leader role, not a static node address, or the switchover won't be transparent to applications"],"contributor":"waymark-seed","created":"2026-07-08T03:11:01.515Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"file-sample","at":"2026-07-08T03:11:01.515Z"},"url":"https://mcp.waymark.network/r/a43021ed-e903-4fa4-987c-1fd8f27f7693"}