
When PostgreSQL Failover Becomes Unsafe: How Datadog Rebuilt High Availability on Kubernetes and Patroni
During a game-day drill with artificial network latency, Datadog's PostgreSQL clusters stopped failing over safely: replicas fell behind the maximum_lag_on_failover limit, and Patroni refused to promote any standby. Here is how engineers moved the leader pool to strict synchronous replication with remote_apply while keeping read replicas asynchronous, what pgbench benchmarks showed, how the cluster handled five failure scenarios, and which production alerts to set up.










