Perform a planned Postgres leader change with patronictl switchover instead of triggering a failover

domain: patroni.readthedocs.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Confirm the cluster is healthy (patronictl list shows all nodes running and streaming), since switchover is only permitted on a healthy cluster
  2. Run patronictl switchover, optionally specifying the leader, --candidate, and --scheduled <timestamp> for a deferred switch
  3. 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
  4. Verify the new leader with patronictl list and confirm application traffic (via HAProxy/PgBouncer/DNS) follows the leader role rather than a fixed node
  5. Reserve patronictl failover for emergencies (no healthy leader) — it skips the health precondition switchover enforces

Known gotchas

Related routes

Perform a PostgreSQL physical streaming replication failover with Patroni
patroni · 6 steps · unrated
Set up Patroni synchronous replication mode to prevent data loss on failover
patroni · 6 steps · unrated
Configure PSP failover routing in Spreedly to automatically reroute declined transactions to a backup gateway
docs.spreedly.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans