Skip to content

No switchover candidate found #1992

@dobrac

Description

@dobrac

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.8.2
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? Bare Metal K8s (microk8s)
  • Are you running Postgres Operator in production? yes
  • Type of issue? Bug report

Helllo,

we are encountering an error while cluster updating (any change in the configuration that needs pods restart), where the master is not correctly switched to the synchronous replica. We have 2 instances, one is master and one is a synchronous replica.

Here is log from the operator, the problem occurs every time:

time="2022-08-10T11:39:52Z" level=info msg="reason: new statefulset containers's postgres (index 0) environment does not match the current one" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:39:52Z" level=debug msg="updating statefulset" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:39:53Z" level=debug msg="making GET http request: http://10.1.63.119:8008/config" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:40:05Z" level=debug msg="making GET http request: http://10.1.11.85:8008/patroni" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:40:05Z" level=debug msg="making GET http request: http://10.1.63.119:8008/patroni" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:40:05Z" level=debug msg="performing rolling update" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:40:05Z" level=info msg="there are 2 pods in the cluster to recreate" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:40:05Z" level=debug msg="subscribing to pod "postgres-qplay/qplay-prod-0"" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:40:27Z" level=info msg="pod "postgres-qplay/qplay-prod-0" has been recreated" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:40:27Z" level=debug msg="unsubscribing from pod "postgres-qplay/qplay-prod-0" events" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:40:27Z" level=debug msg="making GET http request: http://10.1.63.119:8008/cluster" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:40:27Z" level=warning msg="error while syncing cluster state: could not sync statefulsets: could not recreate pods: skipping switchover: no switchover candidate found" cluster-name=postgres-qplay/qplay-prod pkg=cluster
time="2022-08-10T11:40:27Z" level=error msg="could not sync cluster: could not sync statefulsets: could not recreate pods: skipping switchover: no switchover candidate found" cluster-name=postgres-qplay/qplay-prod pkg=controller worker=0
time="2022-08-10T11:40:27Z" level=info msg="received add event for already existing Postgres cluster" cluster-name=postgres-qplay/qplay-prod pkg=controller worker=0

Any idea what could be wrong? It could be definitely some wrong configuration (maybe three instances are the minimum?), but I can't figure out that it is.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions