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

Scaling breaks "The S3 repository has backups from another cluster" blocked status #572

Closed Zvirovyi closed 2 weeks ago

Zvirovyi commented 3 months ago

This is the same bug I've encountered in K8s version of this charm.

Steps to reproduce

  1. juju deploy s3-integrator
  2. juju deploy postgresql --config profile=testing --channel edge
  3. configure s3-integrator to use bucket with backups from another cluster
  4. juju integrate s3-integrator postgresql
  5. as it should be, cluster became in The S3 repository has backups from another cluster blocked status Screenshot
  6. juju add-unit postgresql
  7. after adding unit (scaling), cluster loose it's blocked status and became active idle Screenshot

Expected behavior

Cluster should keep it's blocked status The S3 repository has backups from another cluster even after scaling.

Actual behavior

See step 7.

Versions

Operating system: Ubuntu 24.04 LTS

Juju CLI: 3.5.3-genericlinux-amd64

Juju agent: 3.5.2

Charm revision: 454

LXD: 6.1

Log output

Juju debug log: debug-log

Additional context

Here the message I've already wrote in K8s issue:

From the work on Point In Time Recovery, i can suggest to refactor logic of this blocked message. Now, The S3 repository has backups from another cluster message sets in PostgreSQLBackups._on_s3_credential_changed by can_use_s3_repository func and it's supposed not to be overridden by any of events. But it's better to keep this status in app_peer_data and set this message in PostgresqlOperatorCharm._set_active_status function as it works with blocked status Move restored cluster to another S3 bucket introduced by the PITR work in the PR referenced above.

github-actions[bot] commented 3 months ago

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