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
Do not wait for WAL receivers to stop before promoting a replica #11735
Before the primary lease, a failover or switchover could only select and promote a new primary once every WAL receiver in the cluster had reported itself down. That wait was the safeguard against two instances acting as primary. It also delayed failover and could leave it waiting indefinitely.
Proposal
The primary lease now guarantees that only one instance can act as primary at a time. The WAL receiver wait is therefore redundant and can be removed from the promotion path.
This takes away a source of delay and stuck-waiting states during failover and switchover. Promotion then depends only on the lease: the candidate acquires it, either when the previous holder releases it or when it expires, and then promotes.
This issue is being created after the PR (#11367), exceptionally. The aim is to group all the lease-related changes under the #11721 epic.
Closing as not planned. The WAL receiver wait has to stay for now. The primary lease alone orders the promotion only after a former primary that stops on its own, and that needs an instance manager with the step-down, which 1.30 and older do not have. During an upgrade the former primary can still be on an older manager, keep running after its lease expires and keep streaming WAL, so the receiver wait is the only guard there.
The wait is also bounded in practice. Once the failover is pending, the old primary gets a fast shutdown and then an immediate one, so its walsenders go away and the receivers drop. #11367 is closed.
Activity
mnencia commentedon Oct 28, 2026
Closing as not planned. The WAL receiver wait has to stay for now. The primary lease alone orders the promotion only after a former primary that stops on its own, and that needs an instance manager with the step-down, which 1.30 and older do not have. During an upgrade the former primary can still be on an older manager, keep running after its lease expires and keep streaming WAL, so the receiver wait is the only guard there.
The wait is also bounded in practice. Once the failover is pending, the old primary gets a fast shutdown and then an immediate one, so its walsenders go away and the receivers drop. #11367 is closed.