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

how to initiate a pgbackrest stanza-create? #3711

Open
mzwettler2 opened this issue Aug 23, 2023 · 10 comments
Open

how to initiate a pgbackrest stanza-create? #3711

mzwettler2 opened this issue Aug 23, 2023 · 10 comments

Comments

@mzwettler2
Copy link

we are using s3 storage.

we have to change the whole s3 bucket and repo1-path for some reasons sometimes.

how can we get PGO to initiate a pgbackrest stanza-create if it does not find an existing repo?

it seems that PGO only triggers a pgbackrest stanza-create if there is a completely new configured pgbackrest.repo definition.

@ValClarkson
Copy link
Contributor

Hi @mzwettler2

Sorry you are running into issues. Would you be able to provide me with your manifest and steps? I did some simple testing where I changed buckets and I'm not seeing the same issue.

@mzwettler2
Copy link
Author

Hi @ValClarkson

Sorry for being unclear.

When I change (reconfigure) the whole s3 bucket to a new one it works.

If I only change (reconfgure) the repo1-path within the same s3 bucket to a new path it does not work ==>>
ERROR: [103]: unable to find a valid repository

Thanks

@maksonlee
Copy link

i changed repo1-path too, and then i got the following error when running scheduled backup,

time="2023-09-24T15:35:12Z" level=info msg="stderr=[ERROR: [055]: unable to load info file '/pgbackrest/kubernetes/awx/backup/db/backup.info' or '/pgbackrest/kubernetes/awx/backup/db/backup.info.copy':\n       FileMissingError: unable to open missing file '/pgbackrest/kubernetes/awx/backup/db/backup.info' for read\n       FileMissingError: unable to open missing file '/pgbackrest/kubernetes/awx/backup/db/backup.info.copy' for read\n       HINT: backup.info cannot be opened and is required to perform a backup.\n       HINT: has a stanza-create been performed?\n]"
time="2023-09-24T15:35:12Z" level=fatal msg="command terminated with exit code 55"

@jmckulk
Copy link
Collaborator

jmckulk commented Nov 30, 2023

Sorry for the delay on this.

I would think that if you are changing the path in the bucket you would want to set it up as a new repo. But the repo-path configuration isn't in the repo-host definition 🤔

@mzwettler2 How are you updating the repo path? Would you be able to provide a before and after spec where you are changing it?

@jmckulk jmckulk added the v5 label Nov 30, 2023
@mzwettler2
Copy link
Author

mzwettler2 commented Nov 30, 2023

I define my S3 backup location using these CRDs:

PostgresCluster.spec.backups.pgbackrest.repos[index].s3

  • bucket
  • endpoint
  • region

PostgresCluster.spec.backups.pgbackrest

  • global.repo[index]-path

If I change the repo-path afterwards, the backup terminates incorrectly. I would have to do a stanza-create first - but that is not possible at the moment.

pgo currently only does a stanza-create when you define a new repo or a new bucket. pgo should also do a stanza-create when the repo-path is changed. At the very least, however, there should be the option of triggering the execution of a new stanza-create with an annotation, for example.

@mzwettler2
Copy link
Author

I would need an option to trigger the execution of a new stanza-create.

Anything planned?

@tjmoore4
Copy link
Contributor

tjmoore4 commented Feb 6, 2024

Hi @mzwettler2. Thank you for the additional information. Just to verify what you are suggesting, you are effectively just looking for an imperative way to trigger a stanza-create using the configuration already set on the PostgresCluster spec?
Have you tried exec-ing into your Pod and running the stanza create command directly? I'm curious if that method solved your described scenario.

@mzwettler2
Copy link
Author

@tjmoore4

you are effectively just looking for an imperative way to trigger a stanza-create using the configuration already set on the PostgresCluster spec?

Yes.

Have you tried exec-ing into your Pod and running the stanza create command directly?

Yes, that should work. The problem is that you would have to find out a lot of specific parameter values beforehand in order to be able to carry out the stanza-create suitable for PGO. this is not practicable for our customers.

@tjmoore4
Copy link
Contributor

tjmoore4 commented Feb 7, 2024

@mzwettler2 Understood. I can get something in our backlog for evaluation. In the meantime, I am curious if a command like

kubectl exec -it -n postgres-operator -c database $(kubectl get pods -n postgres-operator --selector='postgres-operator.crunchydata.com/cluster=hippo,postgres-operator.crunchydata.com/role=master' -o name) -- pgbackrest stanza-create --stanza=db

might be useful for this case. This assumes a cluster name of hippo and a namespace named postgres-operator but is otherwise fairly standard in terms of labels and values for lookup.

@mzwettler2
Copy link
Author

@tjmoore4

Thanks for adding something to your backlog.
Sorry for beeing unclear. Our customers are not allowed to use kubectl. They must trigger such an action by an annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants