Post

Designing a planned switchover for minimum disruption

PlanetScale describes how Neki switches a Postgres shard’s primary while preserving acknowledged commits under its synchronous durability policy.

The control plane validates the candidate, buffers primary-bound queries, and makes new transactions read-only by default. It records replica WAL positions, waits for the chosen replica to catch up, and prepares synchronous replication before promotion. If convergence fails before promotion, it can restore the old primary.

Buffering is bounded: queries can still fail if the buffer fills or their deadlines expire. This is a planned switchover, not a solution to failure detection during an unplanned network partition.