Skip to content

Comments

fix: enable LeaderElectionReleaseOnCancel for rolling updates#64

Open
ermakov-oleg wants to merge 1 commit intooperasoftware:mainfrom
ermakov-oleg:fix/leader-election-release
Open

fix: enable LeaderElectionReleaseOnCancel for rolling updates#64
ermakov-oleg wants to merge 1 commit intooperasoftware:mainfrom
ermakov-oleg:fix/leader-election-release

Conversation

@ermakov-oleg
Copy link

Summary

Port of upstream #615

Enables LeaderElectionReleaseOnCancel: true in the controller manager options.

Problem: During rolling updates of the operator deployment, the old pod holds the leader election lease until it expires (default 15s). This means the new pod cannot start reconciliation until the lease times out, causing a gap in controller activity.

Fix: Setting LeaderElectionReleaseOnCancel: true makes the old leader release the lease immediately on context cancellation (graceful shutdown), so the new pod can acquire leadership instantly.

@ermakov-oleg ermakov-oleg force-pushed the fix/leader-election-release branch from 50b0bcb to 2160c8b Compare February 13, 2026 22:52
Port of upstream PR cloudnative-pg#615. Without this flag, RollingUpdate causes deadlock —
old pod holds leader lease preventing new pod from becoming ready.

Signed-off-by: ermakov-oleg <ermakovolegs@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant