K8SPG-740 fix error message#1411
Conversation
| if repoCondition == nil || repoCondition.Status != metav1.ConditionTrue { | ||
| log.Info("pgBackRest repo host not ready, skipping backup cleanup") | ||
| return nil | ||
|
|
…rator into K8SPG-740
| return errors.Wrap(err, "reconcile backup jobs") | ||
| } | ||
|
|
||
| repoCondition := meta.FindStatusCondition(cr.Status.Conditions, postgrescluster.ConditionRepoHostReady) |
There was a problem hiding this comment.
I think we should move this check to cleanupOutdatedBackups method
4c08f48
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shfmt
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1581 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1583 to 1584 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1586 to 1589 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1591 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1593 to 1594 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1598 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1600 to 1605 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1607 to 1610 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1612 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1614 to 1615 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1617 to 1623 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1627 to 1629 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1631 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1633 to 1635 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1637 to 1638 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1640 to 1641 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1643 to 1649 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1653 to 1654 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1656 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1658 to 1660 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1662 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1664 to 1670 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1674 to 1676 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1678 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1680 to 1681 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1683 to 1684 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1686 to 1687 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1689 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1691 to 1694 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1696 to 1703 in 4c08f48
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shfmt
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1581 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1583 to 1584 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1586 to 1589 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1591 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1593 to 1594 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1598 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1600 to 1605 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1607 to 1610 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1612 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1614 to 1615 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1617 to 1623 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1627 to 1629 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1631 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1633 to 1635 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1637 to 1638 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1640 to 1641 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1643 to 1649 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1653 to 1654 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1656 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1658 to 1660 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1662 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1664 to 1670 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1674 to 1676 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1678 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1680 to 1681 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1683 to 1684 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1686 to 1687 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Line 1689 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1691 to 1694 in 4c08f48
[shfmt] reported by reviewdog 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1696 to 1703 in 4c08f48
5441cbd to
e337bf8
Compare
| repoCondition := meta.FindStatusCondition(cr.Status.Conditions, postgrescluster.ConditionRepoHostReady) | ||
| if repoCondition == nil || repoCondition.Status != metav1.ConditionTrue { | ||
| log.Info("pgBackRest repo host not ready, skipping backup cleanup") | ||
| return nil | ||
| } |
There was a problem hiding this comment.
since this function is not using repo host, i am confused how this fixes the issue
There was a problem hiding this comment.
Original error full stacktrace here :
ERROR failed to cleanup outdated backups {"controller": "perconapgcluster", "controllerGroup": "pgv2.percona.com", "controllerKind": "PerconaPGCluster", "PerconaPGCluster": {"name":"cl
uster1","namespace":"pg2502"}, "namespace": "pg2502", "name": "cluster1", "reconcileID": "bf3f58e4-3d58-4112-b6ec-6af38241dcb7", "error": "get pgBackRest info: pgBackRest info command failed with code 99: other", "errorVerb
ose": "pgBackRest info command failed with code 99:
We have
info, err = pgbackrest.GetInfo(ctx, readyPod, repo.Name)
we try to do
which executes pgbackrest info --repo=repo1
If repohost is not ready, we got an error in this case.
There was a problem hiding this comment.
does this assume that repo1 is a PVC and stored in repo host? what happens if repo1 is s3?
There was a problem hiding this comment.
yes, we assume that repo1 pvc,
well we can rewrite check a bit if repo1 is pvc and repohost is not ready, let me know if it will be ok for you.
if repo1 is s3, yee, you right, we will wait until repohost is ready (we don't need to wait it) and delete backups on the next iteration.
There was a problem hiding this comment.
I've verified that RepoHost is only used for pvc. When using S3/Azure repos, pgBackRest connects directly to cloud storage.
Therefore, we should only wait for RepoHost to be ready when the repository type is volume.
commit: cab2526 |
CHANGE DESCRIPTION
Problem:
Short explanation of the problem.
2025-03-04T11:01:27.724Z ERROR failed to cleanup outdated backups
Cause:
Short explanation of the root cause of the issue if applicable.
We encountered an error when attempting to delete backups while the repohost pod was not ready.
We've fixed this by checking the repohost pod status before attempting backup cleanup.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability