Designing a reliable unplanned failover
Nov 5, 2026Shlomi Noach

Summary
This post details Neki's strategy for handling unplanned database failovers. It elaborates on the detection logic, emphasizing the reliance on replica health checks to confirm primary unavailability, rather than solely on Admin's direct checks. It explains how synchronous and asynchronous durability policies affect failover decisions. The post also describes the mechanism for disconnecting replicas from the old primary by prefixing the hostname with '//' and how the new primary is chosen based on the highest replayed WAL position, ensuring data consistency even when replicas have diverged.