canonical / postgresql-operator

A Charmed Operator for running PostgreSQL on machines
https://charmhub.io/postgresql
Apache License 2.0
8 stars 19 forks source link

Error after relating to S3 integrator and the Juju leader unit is not the PostgreSQL primary #330

Closed marceloneppel closed 8 months ago

marceloneppel commented 8 months ago

Steps to reproduce

  1. Deploy 3 units of the PostgreSQL and 1 unit of the S3 integrator charms.
  2. Execute curl -X POST {ip-of-primary-unit}:8008/switchover -d '{"leader": "primary-unit-name-replacing-the-slash-to-hyphen", "candidate": "sync_standby-unit-name-replacing-the-slash-to-hyphen"}'.
  3. Configure the S3 integrator and relate it to PostgreSQL.

Expected behavior

No error (stanza should be initialised correctly).

Actual behavior

Same issue as https://github.com/canonical/postgresql-k8s-operator/issues/370.

2024-01-24 11:12:08 ERROR unit.postgresql/5.juju-log server.go:325 s3-parameters:14: ERROR: [056]: unable to find primary cluster - cannot proceed
       HINT: are all available clusters in recovery?

Versions

Charm revision: 331

Log output

https://pastebin.ubuntu.com/p/PDP6zPP3Fg/

Additional context

Matrix discussion.

github-actions[bot] commented 8 months ago

https://warthogs.atlassian.net/browse/DPE-3380

marceloneppel commented 8 months ago

Revision 367 from the 14/edge channel contains the fix.