-
Notifications
You must be signed in to change notification settings - Fork 64
K8SPG-804: Fix internal.percona.com/delete-backup
finalizer
#1182
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal.percona.com/delete-backup
finalizerinternal.percona.com/delete-backup
finalizer
egegunes
previously approved these changes
Jun 27, 2025
gkech
previously approved these changes
Jun 27, 2025
hors
approved these changes
Jun 30, 2025
commit: 6e5dec0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://perconadev.atlassian.net/browse/K8SPG-804
DESCRIPTION
Problem:
On rare occasions, after executing the finalizer
internal.percona.com/delete-backup
, operator creates a second backup job for singlepg-backup
resource. After that, it is not possible to start new backupsCause:
The
internal.percona.com/keep-job
finalizer tries to delete thepostgres-operator.crunchydata.com/pgbackrest-backup
annotation from thepostgrescluster
. Afterwards, it deletes the labels from the backup job so that they are not included in therepoResources.manualBackupJobs
used in thereconcileManualBackup
method.If the job is included in
reconcileManualBackup
, it gets stuck at https://github.com/percona/percona-postgresql-operator/blob/02cb95c196a93ff03ce044[...]af1f1fe9f0505/internal/controller/postgrescluster/pgbackrest.go, because the finalizerinternal.percona.com/keep-job
is present in the backup job.The
reconcileManualBackup
method creates a new backup job if there is no backup job with these labels and thepostgres-operator.crunchydata.com/pgbackrest-backup
annotation is specified.However, on rare occasions, crunchy's reconcile process can have an outdated version of
postgrescluster
with this annotation specified when it shouldn't be, while having the latest state of the jobs. In this case, the method doesn't find any backup jobs with labels, but it does see the annotation and creates a new backup job which the operator doesn't control. It is expected that backup labels will be deleted from the backup job after each backup.Solution:
Fetch the latest state of the
postgrescluster
cluster in thereconcileManualBackup
method.CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
Config/Logging/Testability