Skip to content

[Bug]: failover can be silently reverted #11346

Description

@leonardoce

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.

Contact Details

[email protected]

Version

1.30.0

What version of Kubernetes are you using?

1.36

What is your Kubernetes environment?

Self-managed: kind (evaluation)

How did you install the operator?

YAML manifest

What happened?

When a failover was in progress and the cluster's target primary was set to the internal "pending" marker, two separate reconciliation bugs could prevent it from ever completing:

  1. The reconcile loop treated the pending marker like any other in-progress switchover and short-circuited every pass with a flat 1-second requeue, never actually checking whether the failover was ready to complete. This could cause the failover to stall indefinitely.
  2. Independently, the status-update logic didn't recognize the pending marker as a special value — it looked for a running instance matching that marker, found none, and concluded the target primary was invalid. It then reset TargetPrimary back to the (unhealthy) current primary, silently undoing the failover that was already underway.

Cluster resource

Relevant log output

Code of Conduct

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

Activity

  1. self-assigned this
    on Aug 20, 2026
  2. added
    bug 🐛
    triage
    on Aug 20, 2026
  3. removed
    triage
    on Sep 18, 2026
  4. moved this to Waiting for Second Review in CloudNativePG operator developmenton Sep 18, 2026
  5. added this to the 1.30.1 milestone on Sep 18, 2026
  6. moved this from Waiting for Second Review to Done in CloudNativePG operator developmenton Sep 19, 2026
  7. added 3 commits that reference this issue on Sep 19, 2026
    54e4dbc
    e4c8349
    dfec5b8
  8. added a commit that references this issue on Sep 19, 2026
    1a97720
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug 🐛

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions