Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot restore PITR if the new cluster has a different app name from the one the backup was performed from #604

Open
marceloneppel opened this issue Aug 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@marceloneppel
Copy link
Member

Steps to reproduce

  1. Deploy the PostgreSQL K8s charm with the application name equal to postgresql-k8s.
  2. Deploy the S3 integrator charm, configure it and relate it to the postgresql-k8s application.
  3. Create a backup, then write some data and later create another backup.
  4. Remove the postgresql-k8s application.
  5. Deploy a new PostgreSQL charm with the application name equal to db.
  6. Relate it to the S3 integrator application and trigger a PITR with juju run db/leader restore restore-to-time="latest" --wait=1000s.

Expected behavior

Restore is successfully completed, and the unit has a status equal to Move restored cluster to another S3 bucket.

Actual behavior

Restore fails, and the unit has a status equal to cannot restore PITR, juju debug-log for details.

Versions

Operating system: Ubuntu 24.04 LTS

Juju CLI: 3.4.5-genericlinux-amd64

Juju agent: 3.4.5

Charm revision: 337

microk8s: v1.29.5 revision 6884

Log output

Juju debug log:

unit-db-0: 23:34:35 ERROR unit.db/0.juju-log Restore failed: database service failed to reach point-in-time-recovery target. You can launch another restore with different parameters
unit-db-0: 23:34:35 ERROR unit.db/0.juju-log Can't tell last completed transaction time

Additional context

The issue happens because the stanza name contains the name postgresql (from the previous PostgreSQL charm deployment), and the new application is using its application name (db) to search for a stanza from which it can perform the PITR.

Copied from VM issue: canonical/postgresql-operator#562.

@marceloneppel marceloneppel added the bug Something isn't working label Aug 1, 2024
Copy link
Contributor

github-actions bot commented Aug 1, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant