feat(replica): clean up Pending PVCs with deleted VolumeSnapshot dataSource by leonardoce · Pull Request #10223 · cloudnative-pg/cloudnative-pg
and others added 2 commits
March 9, 2026 11:40…ge source (#10029) When a cluster is bootstrapped from a VolumeSnapshot that is later deleted, adding replicas would fail because the operator referenced the deleted snapshot as data source for new PVCs, leaving them stuck in Pending state indefinitely. Add VolumeSnapshot existence validation in GetCandidateStorageSourceForReplica and getCandidateSourceFromBackupList. When a referenced snapshot no longer exists, the operator now skips it and tries the next candidate or falls back to pg_basebackup for replica creation. Co-Authored-By: simonapencea <simona@xata.io> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
…ource When a VolumeSnapshot is deleted after a PVC has already been created with it as dataSource, the PVC stays in Pending state indefinitely and the associated restore Job blocks the reconciliation loop. Add DeletePVCsWithMissingVolumeSnapshots to detect Pending PVCs whose VolumeSnapshot dataSource no longer exists and delete them along with any associated Job, allowing the operator to retry replica creation via pg_basebackup on the next reconciliation. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
labels
Mar 9, 2026
leonardoce
changed the title
fix(replica): clean up Pending PVCs with deleted VolumeSnapshot dataSource
feat(replica): clean up Pending PVCs with deleted VolumeSnapshot dataSource
Base automatically changed from dev/10029 to main
March 11, 2026 01:07and removed size:L
This PR changes 100-499 lines, ignoring generated files.labels
Mar 11, 2026This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters