Skip to content

feat(restore): wait for all init containers before starting cluster restore#9026

Merged
mnencia merged 3 commits intomainfrom
dev/improve-restore
Nov 12, 2025
Merged

feat(restore): wait for all init containers before starting cluster restore#9026
mnencia merged 3 commits intomainfrom
dev/improve-restore

Conversation

@armru
Copy link
Member

@armru armru commented Nov 3, 2025

Previously, the cluster restore process immediately returned success without waiting for any init containers to complete. This meant restore operations from backup tools could start before the restore data was fully prepared.

Now the restore process actively waits for all init containers to complete before proceeding. The implementation is tool-agnostic and correctly handles Kubernetes init container sidecars by ignoring those with RestartPolicy=Always.

This ensures that any backup/restore solution using init containers will have sufficient time to prepare the cluster before the restore process proceeds.

Closes #9025

@armru armru requested a review from a team as a code owner November 3, 2025 09:45
@armru armru added the do not backport This PR must not be backported - it will be in the next minor release label Nov 3, 2025
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement 🪄 New feature or request labels Nov 3, 2025
@armru
Copy link
Member Author

armru commented Nov 3, 2025

/test limit=local

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/19030349214

@armru
Copy link
Member Author

armru commented Nov 3, 2025

/test limit=local

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/19030849418

@armru
Copy link
Member Author

armru commented Nov 3, 2025

/test limit=local

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/19031322675

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 5, 2025
@mnencia mnencia force-pushed the dev/improve-restore branch from 078f572 to 2a1f121 Compare November 5, 2025 10:39
@mnencia
Copy link
Member

mnencia commented Nov 5, 2025

/ok-to-merge tests are green

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Nov 5, 2025
@jbattiato jbattiato force-pushed the dev/improve-restore branch from 2a1f121 to c2b113e Compare November 6, 2025 11:18
…estore

Previously, the cluster restore process immediately returned success without waiting
for any init containers to complete. This meant restore operations from backup tools
(Velero, Kasten, etc.) could start before the restore data was fully prepared.

Now the restore process actively waits for all init containers to complete before
proceeding. The implementation is tool-agnostic and correctly handles Kubernetes init
container sidecars by ignoring those with RestartPolicy=Always.

This ensures that any backup/restore solution using init containers will have
sufficient time to prepare the cluster before the restore process proceeds.

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
@mnencia mnencia merged commit f2d631e into main Nov 12, 2025
24 of 27 checks passed
@mnencia mnencia deleted the dev/improve-restore branch November 12, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not backport This PR must not be backported - it will be in the next minor release enhancement 🪄 New feature or request lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Wait for init containers to complete before pod deletion in restored clusters handling

4 participants