Designing a reliable unplanned failover

How Neki detects a failed Postgres primary, and chooses a new one from the WAL that survived.

Sources