zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.37k stars 981 forks source link

Error in postgres-cluster Upgrade - error while syncing cluster state: could not sync statefulsets: #1392

Open neelasha-09 opened 3 years ago

neelasha-09 commented 3 years ago

Hi Team,

We are trying to perform upgrade for the postgres cluster . Below is the operator image and the cluster image being used in deployment:

operator tag: v1.5.0-44-gab95eaa-dirty
cluster Image:  docker-registry-proxy.corp.amdocs.com/acid/spilo-13:2.0-p4

When the upgrade is performed we could see, Out of 2 cluster pods only one pod is terminated and restarted and the below error:

ERROR

time="2021-03-02T11:25:58Z" level=warning msg="error while syncing cluster state: could not sync statefulsets: could not recreate pods: postpone pod recreation until next Sync: recreation is unsafe because pods are being initialized" cluster-name=nts-dev-ocp-install-neelasha1/postgres-operator-cluster pkg=cluster
time="2021-03-02T11:25:58Z" level=error msg="could not sync cluster: could not sync statefulsets: could not recreate pods: postpone pod recreation until next Sync: recreation is unsafe because pods are being initialized" cluster-name=nts-dev-ocp-install-neelasha1/postgres-operator-cluster pkg=controller worker=0
time="2021-03-02T11:25:58Z" level=info msg="Event(v1.ObjectReference{Kind:\"postgresql\", Namespace:\"nts-dev-ocp-install-neelasha1\", Name:\"postgres-operator-cluster\", UID:\"b511b98e-1507-4bed-b3c2-aa3270c9e56e\", APIVersion:\"acid.zalan.do/v1\", ResourceVersion:\"640594780\", FieldPath:\"\"}): type: 'Warning' reason: 'Sync' could not sync cluster: could not sync statefulsets: could not recreate pods: postpone pod recreation until next Sync: recreation is unsafe because pods are being initialized"

Attached is the custom values used for postgres-operator and postgres-cluster deployment.

Could you please let us know how do we overcome this error during upgrade or this error is expected ? Please note: After resync, the cluster is up and running fine .

postgres-cluster.yaml.txt postgres-operator.yaml.txt

FxKu commented 3 years ago

This is now solved @neelasha-09 with configurable AllowPrivilegeEscalation, right?