Repository navigation
Conversation
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
Member
Author
|
/test |
Contributor
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/35750201684 |
…t containers When a backup tool restores an instance Pod together with its PVC, the Pod still carries the bootstrap-instance init container it was created with. Kubernetes only knows that the container belongs to the Pod, not that it already did its job on the volume before the backup, so it runs it again on data that is already live. A join never finds a primary to stream from and an initdb reruns on populated data, so the container never terminates. The restore gate waited for every non-sidecar init container in every instance Pod before deleting the stale Pods. On such a Pod it waited on bootstrap-instance forever, and the deletion that would have replaced the Pod never ran. The gate exists for the init containers a backup tool adds to copy the PVC content back, so it now ignores the operator's own bootstrap-controller and bootstrap-instance containers together with the sidecars it already skipped. Closes #11503 Signed-off-by: Armando Ruocco <[email protected]>
leonardoce
approved these changes
Oct 1, 2026
mnencia
approved these changes
Oct 2, 2026
This 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A backup tool restores an instance Pod with its PVC, so the Pod keeps its
bootstrap-instanceinit container. It reruns on live data and never ends. The restore gate waited for it, so the stale Pod was never deleted.The gate now skips the operator's own init containers (
bootstrap-controllerandbootstrap-instance), like it already skips sidecars.Related: #11491
Closes #11503
When a backup tool restores an instance Pod together with its PVC, the Pod still carries the bootstrap-instance init container it was created with. Kubernetes only knows that the container belongs to the Pod, not that it already did its job on the volume before the backup, so it runs it again on data that is already live. A join never finds a primary to stream from, so the container never terminates.
The restore gate waited for every non-sidecar init container in every instance Pod before deleting the stale Pods, so on such a Pod it waited on bootstrap-instance forever and the deletion that would have replaced the Pod never ran. The gate exists for the init containers a backup tool adds to copy the PVC content back, so it now ignores the operator's own bootstrap-controller and bootstrap-instance containers, together with the sidecars it already skipped.
Verified on kind against a 2-instance cluster whose PVCs, secrets, service account and RBAC were kept while the Cluster was deleted, and whose replica Pod was recreated without owner with a
sleep 60init container in front of its original bootstrap-instance, as a backup tool would do. With main the operator loops on "init container running, waiting for completion" for bootstrap-instance and the cluster never comes up. With this change the stale Pod is deleted as soon as the tool's init container exits and the primary is back within a minute. The recreated replica then fails because the stale join rerun had already renamed its data directory aside, which is #11505 and out of scope here.