Skip to content

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

Description

@mnencia

Is there an existing issue already for this bug?

  • I have searched for an existing issue, and could not find anything. I believe this is a new bug.

I have read the troubleshooting guide

  • I have read the troubleshooting guide and I think this is a new bug.

I am running a supported version of CloudNativePG

  • I have read the troubleshooting guide and I think this is a new bug.

Version

trunk (main)

What version of Kubernetes are you using?

Not specific to a Kubernetes version

What is your Kubernetes environment?

Other

How did you install the operator?

Other

What happened?

With isolationCheck.enabled: false, shouldStepDown returns false before it probes any peer. A primary that cannot reach the API server therefore never learns, from the peers' /failsafe answers, that another instance was named the target primary, and keeps running even when a reachable peer reports it. monitorLeaseAge logs "Not stepping down: the other instances are reachable and agree this is the primary" on every tick, although no peer was probed.

Disabling the check should only mean that an isolated primary is not stopped. A peer that names another target primary is not a sign of isolation, it is proof that the primary was replaced, so it should stop it whatever the setting says. The check moved to the lease in #11357. On 1.30 it is still in the liveness probe, so this is about main.

Seen on kind with main (c9b06b3): 3 instances, enabled: false, the primary's route to the API server dropped with iptables (the peers stay reachable), and status.targetPrimary patched to a replica. The primary kept running for 110 seconds, answering pg_is_in_recovery() = false and accepting an INSERT, and logged "Not stepping down" 67 times. With enabled: true it stopped one second after the patch.

Cluster resource

spec:
  instances: 3
  probes:
    liveness:
      isolationCheck:
        enabled: false

Relevant log output

{"level":"info","ts":"2026-10-27T17:30:23.626936095Z","logger":"primary-lease.primary-lease","msg":"Not stepping down: the other instances are reachable and agree this is the primary, retrying","logger":"instance-manager","logging_pod":"iso-disabled-1","leaseAge":121.798480859}

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    bug 🐛
    triage
    on Oct 27, 2026
  2. added this to the 1.31.0 milestone on Oct 28, 2026
  3. moved this to Waiting for First Review in CloudNativePG operator developmenton Oct 28, 2026
  4. removed
    triage
    on Oct 28, 2026
  5. added a commit that references this issue on Oct 29, 2026
    9986f5b
  6. changed the title [-][Bug]: disabling the primary isolation check leaves an isolated primary running after its lease expires[/-] [+][Bug]: with the primary isolation check disabled, a primary ignores a peer that names another target primary[/+] on Oct 29, 2026
  7. added theissue type on Oct 29, 2026
  8. added a commit that references this issue on Nov 3, 2026
    41dedd3
  9. moved this from Waiting for First Review to Done in CloudNativePG operator developmenton Nov 3, 2026
  10. added a commit that references this issue on Nov 3, 2026
    a50038c
  11. added a commit that references this issue on Nov 3, 2026
    3207622
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛

    Type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions