You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: no clear signal when the primary is lost and only diverged replicas are left #12013
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
No response
Version
trunk (main)
What version of Kubernetes are you using?
1.37
What is your Kubernetes environment?
Self-managed: kind (evaluation)
How did you install the operator?
YAML manifest
What happened?
#11251 fences a replica that diverged from the primary's timeline and never promotes it. The fence stays until the replica is rebuilt.
This is a rare corner case that needs several failures in a row. A failover promotes a replica that was behind another one, so the other one diverges and is fenced. Then the new primary is lost for good (its node and its volume) before the diverged replica is rebuilt, and no healthy replica exists. I reproduced it on kind with 3 instances.
In that state there is nothing to promote and the cluster stays without a primary. Skipping the election is correct, but the cluster does not say why. The phase is "Waiting for the instances to become active", with the reason "Some instances are not yet active. Please wait.". The operator logs one Info line, about once per second: "No promotable candidate found, every instance is fenced, skipping the election". It does not mention the divergence. ReplicasHealthy stays False with reason ReplicasDiverged, but it describes the replica, not the missing primary. The fencing event tells the user to rebuild the replica with kubectl cnpg destroy, which needs a working primary.
failure_modes.md only covers rebuilding a diverged replica from a working primary.
It should be rare, but when it happens the cluster has no primary and nothing states the cause. I expected the cluster to say why it has no primary.
Activity
fix(failover): say why no primary is elected when replicas diverged
fix(failover): say why no primary is elected when replicas diverged