percona-postgresql-operator
percona-postgresql-operator copied to clipboard
K8SPG-803 specify log level info when pgbackrest is executed through cli - GetInfo
CHANGE DESCRIPTION
Problem:
When the following is configured
backups:
pgbackrest:
global:
log-level-console: debug
Then we observed this log
2025-06-26T10:13:16.149Z ERROR failed to cleanup outdated backups {"controller": "perconapgcluster", "controllerGroup": "pgv2.percona.com", "controllerKind": "PerconaPGCluster", "PerconaPGCluster": {"name":"cluster1","namespace":"nofix"}, "namespace": "nofix", "name": "cluster1", "reconcileID": "aaa07465-e2a8-4a21-bf8c-65b3cd077996", "error": "get pgBackRest info: failed to unmarshal pgBackRest info output: invalid character '-' after top-level value", "errorVerbose": "invalid character '-' after top-level value\nfailed to unmarshal pgBackRest info output\ngithub.com/percona/percona-postgresql-operator/percona/pgbackrest.GetInfo\n\t/go/src/github.com/percona/percona-postgresql-operator/percona/pgbackrest/pgbackrest.go:67
And the pg-backup resource remains in running stateforever. New backups are not started.
Cause: Short explanation of the root cause of the issue if applicable.
Solution:
// Setting --log-level-console=info is needed because if the --log-level-console=debug is configured
// through `backups.pgbackrest.global`, the stdout output contains additional text output that
// cannot be unmarshalled to InfoOutput without further processing.
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?
| Test name | Status |
|---|---|
| backup-enable-disable | passed |
| custom-extensions | passed |
| custom-tls | passed |
| demand-backup | passed |
| finalizers | passed |
| init-deploy | passed |
| monitoring | passed |
| monitoring-pmm3 | 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 21 out of 21 |
commit: https://github.com/percona/percona-postgresql-operator/pull/1186/commits/789513c5214c29ec54571c18bf3467b888168ff0
image: perconalab/percona-postgresql-operator:PR-1186-789513c52