zalando / zalando/postgres-operator
Rolling Restart causes UpdateFailed status on CR for a long time
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.2k
- Forks
- 1.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 3
Description
Please, answer some short questions which should help us to understand your problem / question better?
- Which image of the operator are you using? e.g. v1.7
- Where do you run it - cloud or metal? Kubernetes or OpenShift? vmware tanzu k8s
- Are you running Postgres Operator in production? yes
- Type of issue? Bug report
I am trying to force rolling restart by patching the spec of StatefulSet, which does cause the rolling restart but during the rolling restart I get the error:
time="2022-11-07T10:11:07Z" level=error msg="could not sync roles: error executing sync statements: could not execute sync requests for users: [could not alter user \"superuser\": pq: cannot execute ALTER ROLE in a read-only transaction]" cluster-name=default/eerim-testdb-30 pkg=cluster worker=1
Which causes the Postgresql custom resource to change its state to UpdateFailed, this does seem to fix itself after some time and I can see the status is back to Running again eventually, but it really takes a long time to remediate this while there seems to be no actual problem with the status of the StatefulSet (spec is updated), the pods are running and even in postgresql resource PodAnnotations are updated as well with the patch.
Why are we syncing roles in the first place during a patch that seems unrelated to the roles?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported StatefulSet patch and the logged role-sync error during rolling restart; compare the CR status transition with the StatefulSet and pod states described. Done means identifying why role synchronization runs for this update and defining the correction or behavior that prevents the prolonged UpdateFailed status.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, postgresql
- Domain
- databases, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100