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

Successful restore does not trigger all the related events #579

Closed Zvirovyi closed 3 weeks ago

Zvirovyi commented 2 months ago

Steps to reproduce

  1. Deploy postgresql with s3-integrator
  2. Create full backup (juju run postgresql/leader create-backup)
  3. Restore it (juju run postgresql/leader restore backup-id=<your_value>)

Expected behavior

After successful restore, cluster should print message "Restore succeeded" in the debug-log and Patroni restart condition should be restored.

Actual behavior

Cluster appears in the "Move restored cluster to another S3 bucket" and it indicates, that restore process is finished. But there is no "Restore succeeded" message in the debug-log and Patroni restart condition isn't really restored - juju show-unit postgresql/0 shows related fields:

overridden-patroni-restart-condition: always
overridden-patroni-restart-condition-repeat-cause: restore-backup

Overall, it leads to the conclusion, that successful restore does not trigger all its events and does not restore cluster to the fully working state.

Versions

Operating system: Ubuntu 24.04 LTS

Juju CLI: 3.5.3-genericlinux-amd64

Juju agent: 3.5.3

Charm revision: from ~ 436 to current (456)

LXD: 6.1

Log output

Juju debug log: current rev - vm_is_restore_finished_backupid.log, before commit - vm_is_restore_finished_precommit_backupid.log

Additional context

I've found specific commit that causes this issue: ac88aca4849043ee7cec19dbdf768a41b3e45ae6 (#521). I think this issue will be critical when working on Timelines management for the PITR.

github-actions[bot] commented 2 months ago

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