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

K8SPG-637: disable restore on pg-restore deletion #950

Merged
merged 34 commits into from
Jan 24, 2025
Merged

K8SPG-637: disable restore on pg-restore deletion #950

merged 34 commits into from
Jan 24, 2025

Conversation

pooknull
Copy link
Contributor

@pooknull pooknull commented Nov 18, 2024

K8SPG-637 Powered by Pull Request Badge

https://perconadev.atlassian.net/browse/K8SPG-637

DESCRIPTION

Problem:
If user deletes pg-restore before it fails or succeeds, the operator doesn't remove .spec.backup.restore from pg.

Solution:
Add the percona.com/delete-restore finalizer to the new pg-restore objects, which will remove the required section on deletion of pg-restore if it didn't fail or succeed.

This PR also fixes K8SPG-700, by adding percona.com/delete-backup finalizer to the new pg-backup objects. This finalizer will delete backup annotations from cr.

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?

@pooknull pooknull marked this pull request as ready for review November 21, 2024 11:15
@egegunes egegunes added this to the v2.6.0 milestone Nov 25, 2024
egegunes
egegunes previously approved these changes Dec 11, 2024
Copy link
Contributor

@inelpandzic inelpandzic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pooknull pls check these tests

inelpandzic
inelpandzic previously approved these changes Dec 20, 2024
Copy link
Collaborator

@hors hors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the same issue with backups as well. I will create separate task to fix it.

gkech
gkech previously approved these changes Jan 17, 2025
gkech
gkech previously approved these changes Jan 20, 2025
@hors hors requested review from hors, nmarukovich and egegunes January 20, 2025 13:50
Comment on lines 551 to 554
if checkBackupJob(job) != v2.BackupSucceeded {
if err := c.Delete(ctx, job); err != nil {
return nil, errors.Wrap(err, "delete pg-backup job")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we delete the backup job?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleting job might make debugging hard for users

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

egegunes
egegunes previously approved these changes Jan 22, 2025
gkech
gkech previously approved these changes Jan 22, 2025
@pooknull pooknull dismissed stale reviews from gkech and egegunes via 92b7940 January 22, 2025 22:49
@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: f21b507
image: perconalab/percona-postgresql-operator:PR-950-f21b5074e

@egegunes egegunes merged commit 78e1954 into main Jan 24, 2025
17 checks passed
@egegunes egegunes deleted the K8SPG-637 branch January 24, 2025 15:51
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.

7 participants