Repository navigation
Conversation
|
❗ By default, the pull request is configured to backport to all release branches.
|
65e4ebc to
fedbf8c
Compare
|
/test limit=local |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/15947437333 |
|
@jmealo What is missing to move this in ready for review? |
|
@mnencia I haven't been able to test it on a cluster yet. I've only run the automated tests. |
|
@mnencia I still haven't had a chance to test this in a cluster. I likely won't have time for another month. |
|
Issues I see:
|
3e7779e to
ae614ef
Compare
|
I'm working on fixing the issues I flagged here. Let me know if there's anything else that needs to be cleaned up. I'm trying to find the best way to surface this condition to folks since cleaning up stuck pods might make it difficult to troubleshoot the issue if it persists. For example, |
ae614ef to
46b614b
Compare
| // defaultStuckJobTimeout is the duration after which a job with no progress is considered stuck | ||
| // This should be long enough to allow for normal PostgreSQL operations like backup restoration | ||
| // but short enough to prevent indefinite blocking of cluster operations | ||
| defaultStuckJobTimeout = 10 * time.Minute |
There was a problem hiding this comment.
I have no idea what's a reasonable value here. Thoughts?
| @@ -673,6 +673,12 @@ const ( | |||
|
|
|||
| // PhaseCannotCreateClusterObjects is set by the operator when is unable to create cluster resources | |||
| PhaseCannotCreateClusterObjects = "Unable to create required cluster objects" | |||
|
|
|||
| // PhaseScalingUp when scaling up the cluster | |||
| PhaseScalingUp = "Scaling up" | |||
There was a problem hiding this comment.
We didn't have these in a const, so I added them here, not sure if that's the way to go?
|
/test |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/17583622176 |
Signed-off-by: Jeff Mealo <[email protected]>
46b614b to
5708665
Compare
|
@armru @mnencia I'm closing this PR because it's unwieldy and tries to do too much. Now that I've had some time to think about it, a more iterative approach would be best. This PR is superseded by: I've implemented the approach below: Proposed ApproachPR 1: Handle failed/deleted jobs (core fix)
All signals are deterministic (no timeouts). PR 2: Fallback from snapshot to pg_basebackup
Future: Stuck job detection |
|
❗ By default, the pull request is configured to backport to all release branches.
|
Fix stuck reconciliation loop for failed snapshot recovery jobs #7793
This PR is superseded by:
#10004
#10005
Problem
CloudNativePG clusters get stuck in "Creating a new replica" phase when snapshot recovery jobs fail, even when the cluster already has the correct number of replicas. Currently requires manual intervention to recover.
Solution
Adds automatic detection and recovery:
Key Changes
New Files
pkg/utils/jobs.go- Job state detection utilitiespkg/utils/jobs_test.go- Unit testsModified
internal/controller/cluster_controller.go- Added stuck detection/recovery logicapi/v1/cluster_types.go- Added scaling phase constantsExample Scenario
Testing Required
Before Merging
Test Instructions
Configuration
Risks
Future Work
Questions for Reviewers:
This PR is superseded by:
#10004
#10005