Skip to content

[Bug]: The current failover logic skips failover when the HTTP health check fails but the pod is still marked Ready (IsPodReady == true). #10430

Closed as not planned

Description

@bramhanandlingala

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.29 (latest patch)

What version of Kubernetes are you using?

1.35

What is your Kubernetes environment?

Self-managed: kind (evaluation)

How did you install the operator?

YAML manifest

What happened?

The failover decision logic does not incorporate Kubernetes readiness signals (IsPodReady) and instead relies solely on HTTP-based health checks, which can produce false negatives during transient node-level disruptions.

The operator’s failover logic currently relies on its internal HTTP health check (/pg/status) to determine instance availability. When this HTTP check fails, the instance is considered unreachable, regardless of the Kubernetes pod readiness state.

Although the operator already collects the pod readiness status (IsPodReady) from the kubelet, this information is not used in the failover decision path.

This can lead to premature and incorrect failovers in environments where pods may become temporarily unresponsive without actually failing.

A common scenario occurs during infrastructure events such as virtual machine live migrations (e.g., in managed Kubernetes environments like AKS), where:

The node hosting the pod is temporarily paused for several seconds
The operator’s HTTP request times out during this pause
The kubelet, also paused, continues to report the pod as Ready
The operator interprets this as a failure and triggers a failover

Once the node resumes, the original primary instance may still be running as primary, leading to:

Potential split-brain conditions
Inconsistent cluster state
Unnecessary failover operations

Cluster resource

Relevant log output

Code of Conduct

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

Activity

  1. dosubot commented on Apr 11, 2026

    @dosubot

    Hi @bramhanandlingala! I'm Dosu and I’m helping the cloudnative-pg team.

    This is a duplicate of #10423 [1], which was filed by a maintainer on April 8 and describes the same gap: the operator initiates failover based solely on its HTTP health check timeout without verifying that the kubelet has also marked the pod as NotReady.

    PR #10428 is currently open to address this. The proposed fix checks IsPodReady in the failover initiation path — if the operator's HTTP check fails but the kubelet still considers the pod Ready, the operator waits rather than immediately triggering failover. This naturally provides ~30s of protection (readiness probe period=10s × failure threshold=3), which covers most VM live migration windows [1].

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about cloudnative-pg Share Dosu with your team

  2. added
    bug 🐛
    and removed on Jun 21, 2026
  3. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open for 60 days with no activity.

  4. github-actions commented on Oct 20, 2026

    @github-actions
    Contributor

    This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stalebug 🐛triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions