You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: detect a replica that diverged from the primary's timeline and keep it out of service #12007
Is there an existing issue already for this feature request/idea?
I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.
What problem is this feature going to solve? Why should it be added?
After a failover or switchover, a replica can have replayed WAL past the point where the new primary's timeline forked away from its own. It can never follow the new primary. PostgreSQL logs "new timeline N forked off current database system timeline N-1 before current recovery point X/Y" and the replica waits for WAL that never arrives.
The operator does not notice. With the default probes the replica stays ready, the cluster stays in "Cluster in healthy state", and the replica stays in the -r and -ro services. Reads from it are stale and can return writes that the failover discarded.
It can also be promoted: the election orders replicas by LSN and ignores the timeline, so it wins while its LSN is the highest, or when it is the only replica. That brings the discarded writes back and loses every write made after the failover.
Its HA replication slot on the primary stays, so the primary keeps WAL for it without limit.
No status field, condition, event or metric reports it. cnpg_pg_replication_lag even reads 0 on that replica. The user has to find the PostgreSQL log line.
changed the title [-][Bug]: a replica that diverged from the primary's timeline stays ready and can be promoted[/-][+][Feature]: detect a replica that diverged from the primary's timeline and keep it out of service[/+]on Nov 24, 2026
Activity
[-][Bug]: a replica that diverged from the primary's timeline stays ready and can be promoted[/-][+][Feature]: detect a replica that diverged from the primary's timeline and keep it out of service[/+]feat(failover): detect and contain a replica that diverged from the p…
feat(failover): detect and contain a replica that diverged from the p…