You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Operator stuck in reconciliation loop #9885
I have searched for an existing issue, and could not find anything. I believe this is a new bug.
I have read the troubleshooting guide
I have read the troubleshooting guide and I think this is a new bug.
I am running a supported version of CloudNativePG
I have read the troubleshooting guide and I think this is a new bug.
Contact Details
No response
Version
1.28 (latest patch)
What version of Kubernetes are you using?
1.32
What is your Kubernetes environment?
Self-managed: kind (evaluation)
How did you install the operator?
Helm
What happened?
After operator upgrade to version 1.28, operator stuck in reconciliation loop.
We have about 100 clusters in stage env, some cluster are fine, some clusters stuck with "Waiting for the instances to become active" status.
Operator flood the logs with similar messages, where "db-name" is random db name . PVCs status is OK and databases are functional.
Hi @jurim76! I'm Dosu and I’m helping the cloudnative-pg team.
This is a known issue in CloudNativePG, especially after upgrades or when certain changes are applied. The operator gets stuck in a reconciliation loop with "Waiting for the instances to become active" and floods logs with "Updating pvc metadata" when it can't bring all pods to a ready state. This is usually caused by one of these scenarios:
Simultaneous changes to both storage (PVC size) and resource requests/limits in a single update. This can deadlock the operator, as it waits for PVCs to resize while pods can't restart due to resource changes, or vice versa. The recommended workaround is to always apply storage and resource changes in separate steps, waiting for the cluster to become healthy after each change before proceeding to the next. If the cluster is already stuck, try deleting the affected pod and PVC (not the primary) to force recreation, or make a small data change on the primary to trigger a state update. ReferenceReference
Missing or incorrect labels/annotations on PVCs (especially WAL PVCs) can also cause the operator to be stuck in reconciliation, even if the database is functional and PVCs are "Bound". Double-check that all PVCs have the expected labels and annotations. Reference
The operator's reconciliation logic is strict about PVC metadata. If any required label or annotation is missing or incorrect, it will continuously attempt to patch PVCs, resulting in log flooding if the underlying PVC or pod state cannot progress. Reference
The "Waiting for the instances to become active" phase is set when not all expected pods are active/ready. The operator will remain in this phase and continue reconciling until all instances are ready. Reference
Best practices: never combine PVC and resource changes in one operation, and always check PVC and pod status if you see this loop. If you need more targeted help, sharing the output of kubectl get pods,pvc -n <namespace> and the relevant cluster YAML can help pinpoint the issue.
Increasing the primary PVC and deleting the replica didn't help for me in some cases.
Also "Simultaneous changes to both storage (PVC size) and resource requests/limits in a single update. This can deadlock the operator" sounds strange to me, I guess the operator should handle this scenario without any issues.
This scenario is a known limitation in CloudNativePG. The operator does not currently have logic to coordinate or block simultaneous changes to PVC size and resource requests/limits, which can lead to a deadlock: the operator waits for PVCs to finish resizing before restarting pods, but the PVC resize itself may require a pod restart to complete. If both changes are applied together, neither can progress, and the cluster gets stuck in the "Waiting for the instances to become active" phase, with repeated PVC metadata updates in the logs. This is confirmed by both user reports and the codebase—there's no sequencing or validation to prevent this situation, and the reconciliation loop will just keep retrying until the deadlock is resolved manually (details, code reference).
Increasing the primary PVC and deleting a replica may not resolve the issue if the deadlock is already in place or if there are other stuck pods/PVCs. The best practice is to always apply storage and resource changes in separate steps, waiting for the cluster to become healthy after each change. If a cluster is already stuck, deleting the affected pod and PVC (not the primary) can sometimes force recovery, but in some cases, a more manual intervention or even restoring from backup may be needed (example, troubleshooting).
This is a gap in the current operator logic, and improvements to handle or prevent these deadlocks are still open for future development.
Activity
dosubot commentedon Feb 4, 2026
Hi @jurim76! I'm Dosu and I’m helping the cloudnative-pg team.
This is a known issue in CloudNativePG, especially after upgrades or when certain changes are applied. The operator gets stuck in a reconciliation loop with "Waiting for the instances to become active" and floods logs with "Updating pvc metadata" when it can't bring all pods to a ready state. This is usually caused by one of these scenarios:
Simultaneous changes to both storage (PVC size) and resource requests/limits in a single update. This can deadlock the operator, as it waits for PVCs to resize while pods can't restart due to resource changes, or vice versa. The recommended workaround is to always apply storage and resource changes in separate steps, waiting for the cluster to become healthy after each change before proceeding to the next. If the cluster is already stuck, try deleting the affected pod and PVC (not the primary) to force recreation, or make a small data change on the primary to trigger a state update. Reference Reference
Missing or incorrect labels/annotations on PVCs (especially WAL PVCs) can also cause the operator to be stuck in reconciliation, even if the database is functional and PVCs are "Bound". Double-check that all PVCs have the expected labels and annotations. Reference
The operator's reconciliation logic is strict about PVC metadata. If any required label or annotation is missing or incorrect, it will continuously attempt to patch PVCs, resulting in log flooding if the underlying PVC or pod state cannot progress. Reference
The "Waiting for the instances to become active" phase is set when not all expected pods are active/ready. The operator will remain in this phase and continue reconciling until all instances are ready. Reference
Best practices: never combine PVC and resource changes in one operation, and always check PVC and pod status if you see this loop. If you need more targeted help, sharing the output of
kubectl get pods,pvc -n <namespace>and the relevant cluster YAML can help pinpoint the issue.To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
jurim76 commentedon Feb 4, 2026
Increasing the primary PVC and deleting the replica didn't help for me in some cases.
Also "Simultaneous changes to both storage (PVC size) and resource requests/limits in a single update. This can deadlock the operator" sounds strange to me, I guess the operator should handle this scenario without any issues.
dosubot commentedon Feb 4, 2026
This scenario is a known limitation in CloudNativePG. The operator does not currently have logic to coordinate or block simultaneous changes to PVC size and resource requests/limits, which can lead to a deadlock: the operator waits for PVCs to finish resizing before restarting pods, but the PVC resize itself may require a pod restart to complete. If both changes are applied together, neither can progress, and the cluster gets stuck in the "Waiting for the instances to become active" phase, with repeated PVC metadata updates in the logs. This is confirmed by both user reports and the codebase—there's no sequencing or validation to prevent this situation, and the reconciliation loop will just keep retrying until the deadlock is resolved manually (details, code reference).
Increasing the primary PVC and deleting a replica may not resolve the issue if the deadlock is already in place or if there are other stuck pods/PVCs. The best practice is to always apply storage and resource changes in separate steps, waiting for the cluster to become healthy after each change. If a cluster is already stuck, deleting the affected pod and PVC (not the primary) can sometimes force recovery, but in some cases, a more manual intervention or even restoring from backup may be needed (example, troubleshooting).
This is a gap in the current operator logic, and improvements to handle or prevent these deadlocks are still open for future development.
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.