Skip to content

feat(instance-manager): make the primary isolation check always active - #11778

Closed
mnencia wants to merge 3 commits into
mainfrom
dev/11777
Closed

mnencia wants to merge 3 commits into
mainfrom
dev/11777

Conversation

@mnencia

@mnencia mnencia commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

With isolationCheck.enabled set to false the lease monitor never stopped the primary, so it kept accepting writes after a replica took over. Promotion after the lease expires is only safe because an isolated primary stops first, so the check now runs whatever the setting says, and the admission webhook warns that the field is ignored. A cluster that set it to false now gets its primary stopped when a peer is unreachable or names another target.

Closes #11777


Not for the squash message. Checked on kind with the operator built from this branch: with enabled: false, the isolated primary's container was stopped before the new primary was promoted. On main, both primaries accepted writes for more than 120 seconds (see #11777). The e2e spec primary_self_isolation_test.go now expects the disabled fixture to terminate the primary too; I vetted and linted it but did not run it. #11367 can drop the isolation check condition from its WAL receiver wait once this lands. Clusters that disabled the check as a workaround for #11641 get its restarts back: one unreachable peer and a lease renewal outage longer than renewDeadlineSeconds stop the primary. They can tune primaryLease and requestTimeout instead.

@mnencia
mnencia requested review from a team, NiccoloFei and litaocdl as code owners October 27, 2026 18:07
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.30 labels Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@mnencia mnencia changed the title fix(instance-manager): make the primary isolation check always active feat(instance-manager): make the primary isolation check always active Oct 27, 2026
@mnencia

mnencia commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

/test

@github-actions

Copy link
Copy Markdown
Contributor

@mnencia mnencia added do not backport This PR must not be backported - it will be in the next minor release and removed backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.30 labels Oct 27, 2026
@mnencia
mnencia force-pushed the dev/11777 branch 2 times, most recently from 35f4c9e to 6fc0e57 Compare October 27, 2026 18:22
@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Oct 27, 2026
mnencia and others added 3 commits October 29, 2026 13:18
With isolationCheck.enabled set to false the lease monitor never stopped
the primary, so it kept accepting writes after a replica took over.
Promotion after the lease expires is only safe because an isolated
primary stops first, so the check now runs whatever the setting says,
and the admission webhook warns that the field is ignored.

Closes #11777

Signed-off-by: Marco Nenciarini <[email protected]>
The warning said that the alpha.cnpg.io/livenessPinger annotation is
ignored and should be removed. Its timeouts are still honored, and the
annotation is copied into the spec only while the isolation check stanza
is missing: once it has set enabled to false, removing it leaves the
field as it is and the warning keeps coming back. The warning now names
the field and says how to clear it.

Signed-off-by: Armando Ruocco <[email protected]>
The timeouts are integers, and the admission webhook rejects the quoted
values the example used.

Signed-off-by: Armando Ruocco <[email protected]>
@mnencia

mnencia commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

I propose to close this in favour of #11795. Making the check always active ignores enabled: false, and that setting is how users choose not to have an isolated primary stopped. It is also the workaround for #11641.

#11795 keeps that meaning and fixes what was actually wrong: a disabled check never looked at its peers, so a primary kept running even when a reachable peer reported that another instance had been named the target primary. With #11795 only that case stops a disabled primary, unreachable peers still do not. I checked it on kind: without the change the primary kept accepting writes for 110 seconds, with it the primary stopped two seconds after the target changed.

The cost is that a disabled check still leaves a fully isolated primary running after its lease expires, which is what disabling it means. The docs in #11795 say so.

If you see a reason to make the check mandatory anyway, say so here. Otherwise I will close this one.

@mnencia mnencia closed this Oct 30, 2026
@mnencia
mnencia deleted the dev/11777 branch October 30, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not backport This PR must not be backported - it will be in the next minor release ok to merge 👌 This PR can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: with the primary isolation check disabled, a primary ignores a peer that names another target primary

3 participants