Use planned switchover only. walshadow verifies descendant timeline and resumes without reloading ClickHouse when target has fully replayed frozen source head
walshadow does not elect leaders, fence old primary, promote PostgreSQL, or move DNS
- target is streaming standby of current primary
- writes can stop before promotion
- target can replay through frozen source head
- target shares source system ID and belongs to same timeline lineage
- required WAL remains available
- when using slots, target already has physical slot covering resume position
Physical slots are not necessary when using object storage, since archive covers WAL retention. Physical slots are not synchronized to standbys. Create target slot before switchover with storage and WAL coverage appropriate for deployment
-
Pause walshadow
walshadow-stream ctl pause walshadow-stream ctl status
Record
pause_consumed_lsnandpause_received_lsnPause leaves the replication stream, so the old primary's walsender exits on its own and step 2's fast shutdown does not wait out
wal_sender_timeout. Resume redials from the same position. Without a replication slot the source may recycle WAL across a long pause; resume then reads the gap from the archive, or stops if neither holds it -
Stop writes on old primary, using application fencing or PostgreSQL fast shutdown
-
Repoint walshadow while target is still in recovery
walshadow-stream ctl source \ 'postgres://replicator@target.internal/app?sslmode=require&slot=walshadow_target'
Stable VIP, proxy, or DNS endpoint can skip explicit repoint
-
Wait for promotion gate
walshadow-stream ctl status
Proceed only when:
promotion_ready = true target_in_recovery = true
When false,
promotion_blocked_onnames missing condition. Do not promote until target replay and receive positions cover frozen source head -
Promote target with normal PostgreSQL tooling
-
Resume walshadow
walshadow-stream ctl resume
-
Watch
ctl statusuntil timeline fields advance andcrossing_blocked_onclears
Pause bounds ClickHouse output to WAL target already owns. Repointing before promotion lets walshadow verify replay on exact server which will become primary. Promotion gate prevents rows from abandoned source branch reaching ClickHouse
Already accepted rows keep draining during pause, so ClickHouse or shadow outage can delay readiness without losing source data
Before promotion, repoint to old primary if changed, then resume. No descendant state has been committed yet
After promotion begins, do not use --ignore-cursor to force progress. Inspect
crossing_blocked_on, crossing_detail, source timeline, slot coverage, and
ClickHouse acknowledgement state
Unplanned promotion while walshadow is consuming old primary can leave transactions or rows beyond fork point. walshadow fails closed instead of compensating ClickHouse
Rebuild from known baseline or restore old planned path after unplanned promotion. See Limits