Repository navigation
fix(restore): break certificate-wait deadlock in orphan-PVC restore - #11492
Merged
Merged
Conversation
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
Member
Author
|
/test |
Contributor
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/35085032523 |
Member
|
/test |
Contributor
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/35111237422 |
armru
approved these changes
Sep 17, 2026
Restoring a multi-instance cluster from orphan PVCs could hang forever. A replica's bootstrap-instance init container waits for the certificate status before it can finish. The restore gate waits for that same init container to finish before the reconcile loop reaches the code that sets the certificate status. Neither side could move. Set the certificate status right away, before the restore gate runs, so the init container's wait ends immediately and the gate sees it finish on the next pass. The regression test runs both sides for real, in separate goroutines: the actual certificate wait and the actual restore gate. Without the fix it times out. Closes #11491 Assisted-by: Claude Signed-off-by: Marco Nenciarini <[email protected]>
Setting up the PKI before the restore gate moved a failure of that step out of createPostgresClusterObjects, which records it in the cluster status as "Cannot create cluster objects". On the orphan-PVC path the same failure, typically a user-specified CA secret that does not exist, only surfaced as a reconcile error and left the phase untouched. Register the same phase from the restore path so the status keeps telling the user what is blocking the cluster. Signed-off-by: Armando Ruocco <[email protected]>
leonardoce
approved these changes
Sep 17, 2026
cnpg-bot
pushed a commit
that referenced
this pull request
Sep 17, 2026
…11492) Restoring a multi-instance cluster from orphan PVCs could hang forever. A replica's bootstrap-instance init container waits for the certificate status before it can finish. The restore gate waits for that same init container to finish before the reconcile loop reaches the code that sets the certificate status. Neither side could move. Set the certificate status right away, before the restore gate runs, so the init container's wait ends immediately and the gate sees it finish on the next pass. The regression test runs both sides for real, in separate goroutines: the actual certificate wait and the actual restore gate. Without the fix it times out. Closes #11491 Assisted-by: Claude Signed-off-by: Marco Nenciarini <[email protected]> Signed-off-by: Armando Ruocco <[email protected]> Co-authored-by: Armando Ruocco <[email protected]> (cherry picked from commit 0d65c25)
leonardoce
pushed a commit
that referenced
this pull request
Sep 17, 2026
…11492) Restoring a multi-instance cluster from orphan PVCs could hang forever. A replica's bootstrap-instance init container waits for the certificate status before it can finish. The restore gate waits for that same init container to finish before the reconcile loop reaches the code that sets the certificate status. Neither side could move. Set the certificate status right away, before the restore gate runs, so the init container's wait ends immediately and the gate sees it finish on the next pass. The regression test runs both sides for real, in separate goroutines: the actual certificate wait and the actual restore gate. Without the fix it times out. Closes #11491 Assisted-by: Claude Signed-off-by: Marco Nenciarini <[email protected]> Signed-off-by: Armando Ruocco <[email protected]> Co-authored-by: Armando Ruocco <[email protected]> (cherry picked from commit 0d65c25) (cherry picked from commit 4f1a9e9)
leonardoce
pushed a commit
that referenced
this pull request
Sep 17, 2026
…11492) Restoring a multi-instance cluster from orphan PVCs could hang forever. A replica's bootstrap-instance init container waits for the certificate status before it can finish. The restore gate waits for that same init container to finish before the reconcile loop reaches the code that sets the certificate status. Neither side could move. Set the certificate status right away, before the restore gate runs, so the init container's wait ends immediately and the gate sees it finish on the next pass. The regression test runs both sides for real, in separate goroutines: the actual certificate wait and the actual restore gate. Without the fix it times out. Closes #11491 Assisted-by: Claude Signed-off-by: Marco Nenciarini <[email protected]> Signed-off-by: Armando Ruocco <[email protected]> Co-authored-by: Armando Ruocco <[email protected]> (cherry picked from commit 0d65c25) (cherry picked from commit 4f1a9e9) (cherry picked from commit b68aaa7)
cnpg-bot
pushed a commit
to cloudnative-pg/api
that referenced
this pull request
Sep 18, 2026
…loudnative-pg/cloudnative-pg#11492) Restoring a multi-instance cluster from orphan PVCs could hang forever. A replica's bootstrap-instance init container waits for the certificate status before it can finish. The restore gate waits for that same init container to finish before the reconcile loop reaches the code that sets the certificate status. Neither side could move. Set the certificate status right away, before the restore gate runs, so the init container's wait ends immediately and the gate sees it finish on the next pass. The regression test runs both sides for real, in separate goroutines: the actual certificate wait and the actual restore gate. Without the fix it times out. Closes cloudnative-pg/cloudnative-pg#11491 Assisted-by: Claude Signed-off-by: Marco Nenciarini <[email protected]> Signed-off-by: Armando Ruocco <[email protected]> Co-authored-by: Armando Ruocco <[email protected]> (cherry picked from commit cloudnative-pg/cloudnative-pg@0d65c25)
4 tasks done
mnencia
added a commit
that referenced
this pull request
Sep 22, 2026
This reverts commit 0d65c25 (#11492). No genuinely new Pod ever reaches the restore gate before the cluster is marked initialized, so #11492 has no legitimate beneficiary: it only changes where a stale bootstrap-instance init container gets stuck. Before #11492, a stale join-role container parked on the certificate wait (#11491). After it, the wait resolves immediately and the same container proceeds into the join step instead, where it now hangs dialing a primary with no running pod (#11503). The initdb-role case (#11505) is unaffected either way, since initdb never waits on certificate status. Reverting restores the #11491 behavior; it does not fix the underlying stale-container bug, which needs its own fix tracked in #11503. Signed-off-by: Marco Nenciarini <[email protected]>
mnencia
added a commit
that referenced
this pull request
Sep 22, 2026
#11548) This reverts commit 0d65c25 (#11492). No genuinely new Pod ever reaches the restore gate before the cluster is marked initialized, so #11492 has no legitimate beneficiary: it only changes where a stale bootstrap-instance init container gets stuck. Before #11492, a stale join-role container parked on the certificate wait (#11491). After it, the wait resolves immediately and the same container proceeds into the join step instead, where it now hangs dialing a primary with no running pod (#11503). The initdb-role case (#11505) is unaffected either way, since initdb never waits on certificate status. Reverting restores the #11491 behavior; it does not fix the underlying stale-container bug, which needs its own fix tracked in #11503. Signed-off-by: Marco Nenciarini <[email protected]>
mnencia
added a commit
that referenced
this pull request
Sep 22, 2026
Signed-off-by: Marco Nenciarini <[email protected]>
cnpg-bot
pushed a commit
that referenced
this pull request
Sep 22, 2026
#11548) This reverts commit 0d65c25 (#11492). No genuinely new Pod ever reaches the restore gate before the cluster is marked initialized, so #11492 has no legitimate beneficiary: it only changes where a stale bootstrap-instance init container gets stuck. Before #11492, a stale join-role container parked on the certificate wait (#11491). After it, the wait resolves immediately and the same container proceeds into the join step instead, where it now hangs dialing a primary with no running pod (#11503). The initdb-role case (#11505) is unaffected either way, since initdb never waits on certificate status. Reverting restores the #11491 behavior; it does not fix the underlying stale-container bug, which needs its own fix tracked in #11503. Signed-off-by: Marco Nenciarini <[email protected]> (cherry picked from commit a6afa71)
mnencia
added a commit
that referenced
this pull request
Sep 23, 2026
#11548) This reverts commit 0d65c25 (#11492). No genuinely new Pod ever reaches the restore gate before the cluster is marked initialized, so #11492 has no legitimate beneficiary: it only changes where a stale bootstrap-instance init container gets stuck. Before #11492, a stale join-role container parked on the certificate wait (#11491). After it, the wait resolves immediately and the same container proceeds into the join step instead, where it now hangs dialing a primary with no running pod (#11503). The initdb-role case (#11505) is unaffected either way, since initdb never waits on certificate status. Reverting restores the #11491 behavior; it does not fix the underlying stale-container bug, which needs its own fix tracked in #11503. Signed-off-by: Marco Nenciarini <[email protected]> (cherry picked from commit a6afa71)
mnencia
added a commit
that referenced
this pull request
Sep 23, 2026
#11548) This reverts commit 0d65c25 (#11492). No genuinely new Pod ever reaches the restore gate before the cluster is marked initialized, so #11492 has no legitimate beneficiary: it only changes where a stale bootstrap-instance init container gets stuck. Before #11492, a stale join-role container parked on the certificate wait (#11491). After it, the wait resolves immediately and the same container proceeds into the join step instead, where it now hangs dialing a primary with no running pod (#11503). The initdb-role case (#11505) is unaffected either way, since initdb never waits on certificate status. Reverting restores the #11491 behavior; it does not fix the underlying stale-container bug, which needs its own fix tracked in #11503. Signed-off-by: Marco Nenciarini <[email protected]> (cherry picked from commit a6afa71)
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.
Restoring a multi-instance cluster from orphan PVCs could hang forever. A replica's bootstrap-instance init container waits for the certificate status before it can finish. The restore gate waits for that same init container to finish before the reconcile loop reaches the code that sets the certificate status. Neither side could move.
Set the certificate status right away, before the restore gate runs, so the init container's wait ends immediately and the gate sees it finish on the next pass.
The regression test runs both sides for real, in separate goroutines: the actual certificate wait and the actual restore gate. Without the fix it times out.
Closes #11491
Assisted-by: Claude