# Designing a planned switchover for minimum disruption

DevFeed: [Designing a planned switchover for minimum disruption](<https://devfeed.tech/articles/designing-a-planned-switchover-for-minimum-disruption-106760.md>)

Original publisher: [Read original article](<https://planetscale.com/blog/designing-a-planned-switchover-for-minimum-disruption>)

Author: Shlomi Noach

Published: 2026-10-29T00:00:00Z

Content type: article

Language: en

Sources: [PlanetScale](<https://devfeed.tech/sources/blog-planetscale.md>)

Topics: [neki](<https://devfeed.tech/topics/neki.md>), [downtime](<https://devfeed.tech/topics/downtime.md>), [control-plane](<https://devfeed.tech/topics/control-plane.md>), [Resilience](<https://devfeed.tech/topics/resilience.md>), [distributed algorithm](<https://devfeed.tech/topics/distributed-algorithm.md>), [Production Engineering](<https://devfeed.tech/topics/production-engineering.md>), [health check](<https://devfeed.tech/topics/health-check.md>)

Tags: [admin](<https://devfeed.tech/tags/admin.md>), [buffer](<https://devfeed.tech/tags/buffer.md>), [candidate](<https://devfeed.tech/tags/candidate.md>), [capacity](<https://devfeed.tech/tags/capacity.md>), [client](<https://devfeed.tech/tags/client.md>), [cluster](<https://devfeed.tech/tags/cluster.md>), [commit](<https://devfeed.tech/tags/commit.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [convergence](<https://devfeed.tech/tags/convergence.md>), [disruption](<https://devfeed.tech/tags/disruption.md>), [durability](<https://devfeed.tech/tags/durability.md>), [election](<https://devfeed.tech/tags/election.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [failover](<https://devfeed.tech/tags/failover.md>), [ha](<https://devfeed.tech/tags/ha.md>), [neki](<https://devfeed.tech/tags/neki.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [primary](<https://devfeed.tech/tags/primary.md>), [query](<https://devfeed.tech/tags/query.md>), [replication](<https://devfeed.tech/tags/replication.md>), [rollback](<https://devfeed.tech/tags/rollback.md>)

## AI overview

Neki reduces disruption during planned Postgres primary switchovers by validating the shard and candidate while the old primary still serves writes, then buffering primary-bound queries before making it read-only. Admin selects a replica, disconnects the others to establish a final WAL position, and waits for the target to replay through it. With synchronous replication configured as `ANY 1`, the target can catch up without a slow replica blocking progress; Admin also prepares replication slots and requires at least one attached replica in the target's synchronous configuration. Routers replan buffered queries against the new topology, so they take longer but usually avoid errors. Failed checks or a deadline trigger rollback: the old primary can be made writable again and other replicas reconnected. Buffers have finite capacity and query deadlines, and not all Routers must acknowledge the buffering signal. Neki contrasts this with Patroni's clean-shutdown approach, which simplifies final WAL accounting but can leave no primary while the old server restarts or rewinds. Under Neki's synchronous durability policy and default `synchronous_commit = on`, acknowledged commits are present.

## Source excerpt

How Neki uses preflight checks, query buffering, synchronous replication, and fast rollback to make Postgres primary switchovers less disruptive.