HOWTO: Execute a PostgreSQL Failover with Patroni¶
A PostgreSQL failover in HybridOps is a rehearsed, reviewable operation — not an ad hoc emergency response. This HOWTO covers both the controlled switchover (planned maintenance) and the emergency failover (primary failure) paths in a Patroni-managed cluster. You will capture before/after cluster state, confirm replica promotion, validate application reconnection, and produce the structured run record that the DR cost drill relies on as reviewable record of rehearsal.
What this covers:
- Controlled switchover via
patronictl switchover: pre-checks, execution, and timing measurement - Emergency failover path: detecting primary loss, triggering failover, and confirming new leader
- Before/after run-record capture: Patroni cluster state, replication lag, and application connectivity