Skip to content

Conversation

@inelpandzic
Copy link
Contributor

@inelpandzic inelpandzic commented Dec 18, 2024

K8SPG-586 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
In our other operators, we have a delete-backup finalizer under backup CR, meaning we can delete the individual backup.
In PG we can’t do that, the only thing we can delete is all the backups from all the repos or backups for a particular repo.

Solution:
Add a percona.com/delete-backups finalizer that will ensure that all backups are removed when the cluster is deleted.

When the finalizer is applied, the operator will basically issue pgbackrest --stanza=db stanza-delete command that will essentially delete all the backups from all the configured repos. Besides removing all the physical backup files, finalizer will also delete all pg-backup objects since there is no reason to leave them dangling around without physical backups that correspond to them.

This is not recommended in production.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

@nmarukovich
Copy link
Contributor

LGFM
But let's use GetPrimaryPod method (as we discussed) when I merge custom extension deletion.

@inelpandzic inelpandzic marked this pull request as ready for review December 23, 2024 14:19
pooknull
pooknull previously approved these changes Dec 24, 2024
pooknull
pooknull previously approved these changes Jan 3, 2025
@egegunes egegunes added this to the v2.6.0 milestone Jan 9, 2025
egegunes
egegunes previously approved these changes Jan 13, 2025
@hors hors dismissed stale reviews from egegunes and pooknull via 6b40cef January 13, 2025 14:39
@hors hors requested a review from gkech as a code owner January 13, 2025 14:39
hors
hors previously approved these changes Jan 13, 2025
@hors hors self-requested a review January 15, 2025 13:29
@JNKPercona
Copy link
Collaborator

Test name Status
custom-extensions passed
custom-tls passed
demand-backup passed
finalizers passed
init-deploy passed
monitoring passed
one-pod passed
operator-self-healing passed
pitr passed
scaling passed
scheduled-backup passed
self-healing passed
sidecars passed
start-from-backup passed
tablespaces passed
telemetry-transfer passed
upgrade-consistency passed
upgrade-minor passed
users passed
We run 19 out of 19

commit: 092fab0
image: perconalab/percona-postgresql-operator:PR-989-092fab03e

@hors hors requested review from egegunes and pooknull January 17, 2025 14:00
@egegunes egegunes merged commit 2fb9325 into main Jan 17, 2025
17 checks passed
@egegunes egegunes deleted the K8SPG-586-delete-backups-finalizer branch January 17, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants