[Bug]: rapid termination of two replicas leads to stalled recovery
I maintainer di solito rispondono entro 1 giorno
@gbartolini ci sta già lavorando.
Dal 22/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
Version
1.30 (latest patch)
What version of Kubernetes are you using?
1.37
What is your Kubernetes environment?
Cloud: Amazon EKS
How did you install the operator?
YAML manifest
What happened?
A 3-instance cluster using synchronous replication and:
number: 1
failoverQuorum: true
can deadlock during a failover if the primary and one of the quorum-set replicas are preempted around the same time (in my case within about 1 second). Yes we should probably not be allowing preemption but I don't think it should lead to a total cluster stall.
The operator seemed to initiate failover fine when the primary became unhealthy and set targetPrimary to pending and waited for WAL receivers to go down. Then the second quorum-set replica disappeared and PR #11336 quorum re-check correctly returned ErrQuorumCheckFailed because only one member of the quorum set remains. It enters a loop logging Refusing to restore future timeline history file.
The operator loop handles that error by logging There is a switchover or a failover in progress, waiting for the operation to complete and returning a 1-second requeue result, which skips reconcileResources. Therefore it never reaches the pod/PVC reconciliation that would recreate the missing replica from its existing PVC.
Cluster resource
Relevant log output
| Time | Event (source) |
|---|---|
| 11:02:40.313 | kube-scheduler: "Preemptor Pod preempted victim Pod" victim=instance-3 (**primary**), preemptor = higher-priority app pod |
| 11:02:40.323 | instance-3: "Received termination signal", "Requesting smart shutdown" |
| 11:02:40.608 | operator: "Quorum check algorithm results" isStronglyConsistent=**true**, readSet=[1,2], W=1, N=2 |
| 11:02:40.608 | operator: pod status, both replicas ready, receivedLsn = replayLsn = `1AD/3706D628` |
| 11:02:40.608 | operator: "Current primary isn't healthy, initiating a failover"; sets `targetPrimary=pending`; "Setting primary label to unhealthy in the old primary" |
| 11:02:40.661 → 11:05:40.315 | operator: "Waiting for all WAL receivers to be down to elect a new primary" (169×). instance-1 still streaming from instance-3, which is in smart shutdown |
| 11:02:41.459 | kube-scheduler: preempted victim=instance-2 (**replica, member of quorum node set**) |
| 11:02:41.64 | instance-2: "database system is shut down" (shut down in recovery) |
| 11:05:40.743 | instance-3: smart-shutdown timeout hit, "checkpoint starting: shutdown immediate" |
| 11:05:40.993 | instance-3: checkpoint complete, lsn=`1AD/39000028`; instance-1: "replication terminated by primary server" |
| 11:05:41.440 | operator: quorum re-check isStronglyConsistent=**false**, readSet=[1]; "Strong consistency check failed. Preventing failover."; "Quorum check no longer satisfied, waiting before completing the failover" |
| 11:05:42.170 | instance-1: replayed to `1AD/390000A0` (end of valid WAL, past the shutdown checkpoint) |
| 11:05:43 | instance-3 pod deleted |
| 11:05:43 → ongoing | Every reconcile (~1 s): "Old primary pod not found in managed instances, skipping label demotion", "There is a switchover or a failover in progress…", quorum check fails. 13,000+ times. Status: `currentPrimary=instance-3`, `targetPrimary=pending` |
| after 11:05 | **No pod create** for instance-2 or instance-3 in the API audit log. Earlier preemptions this week were recreated by the operator within ~1 min |
Code of Conduct
- I agree to follow this project's Code of Conduct
- Lingua principale
- Go
- Stelle
- 9.7k
- Fork
- 826
- Merge medio
- 2g 1h
- PR unite (30g)
- 122
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudnative-pg/cloudnative-pg
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
cloudnative-pg/cloudnative-pg#12059 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Docs]: Document the egress traffic that instance pods need when a NetworkPolicy restricts egressForse di nuovo libera @fjvbn2003 l’ha presa 13 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cloudnative-pg/cloudnative-pg#11750 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: A failed plugin backup sets the deprecated `status.lastFailedBackup`, so `cnpg_collector_last_failed_backup_timestamp` stays newer than the last available backupForse di nuovo libera @fjvbn2003 l’ha presa 13 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudnative-pg/cloudnative-pg#11749 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Managed role stays pending-reconciliation when a membership has several grantor rowsForse già presa @MatheuslFavaretto l’ha presa 45 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cloudnative-pg/cloudnative-pg#11624 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: enablePDB=false deletes independently managed PDBs with matching namesForse già presa @WoahitsJoe l’ha presa 61 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
cloudnative-pg/cloudnative-pg#11600 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cloudnative-pg/cloudnative-pg
Issue simili
-
feat(arithmetization): update `arithmetization` to ZkC version `v1.2.38`Forse già presa @DavePearce l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
LFDT-Lineth/lineth-monorepo#4679 ·
I maintainer di solito rispondono entro 1 giorno
-
macOS: MixMusic stalls as the GPU times out drawing frames, and the media keys fail to register at every startForse già presa @fzn0x l’ha presa oggi. Apertabug priority: high
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
funding: failure logs print `<nil>` error and zero channel IDForse già presa @litbot-9000 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
lightningnetwork/lnd#11676 ·
I maintainer di solito rispondono entro 1 giorno
-
effort:s impact:low raised-by:reviewer risk:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
medici-finance/assay#8050 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno