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-643: Fix stanza-upgrade after major upgrade #911

Merged
merged 4 commits into from
Sep 26, 2024
Merged

K8SPG-643: Fix stanza-upgrade after major upgrade #911

merged 4 commits into from
Sep 26, 2024

Conversation

egegunes
Copy link
Contributor

@egegunes egegunes commented Sep 25, 2024

K8SPG-643 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:

Operator first runs stanza-create and if it fails with backup and archive info files exist but do not match the database in the error, it runs stanza-upgrade. The problem is operator tries to find this string in pgbackrest stanza-create command's stderr but it's printed to stdout because of this commit in pgbackrest v2.53.

Solution:

  1. Check both stdout and stderr for the messages.
  2. Add backups and restores to major-upgrade test.

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?
  • 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?

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.

@egegunes please check test

--- FAIL: TestReconcileStanzaCreate (0.52s)
    helpers_test.go:180: Manager started
    pgbackrest_test.go:764: assertion failed: expected error "fake stanza create failed: ", got "fake stanza create failed:  "
        fake stanza create failed:  
        github.com/percona/percona-postgresql-operator/internal/pgbackrest.Executor.StanzaCreateOrUpgrade
        ...
        W0925 19:03:29.921842   18019 reflector.go:484] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:243: watch of *v1.Secret ended with: an error on the server ("unable to decode an event from the watch stream: context canceled") has prevented the request from succeeding
W0925 19:03:29.921911   18019 reflector.go:484] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:243: watch of *v1.StatefulSet ended with: an error on the server ("unable to decode an event from the watch stream: context canceled") has prevented the request from succeeding
FAIL
coverage: 77.7% of statements
FAIL	github.com/percona/percona-postgresql-operator/internal/controller/postgrescluster	43.870s

and e2e major-upgrade test as well

@JNKPercona
Copy link
Collaborator

Test name Status
custom-extensions passed
custom-tls passed
demand-backup passed
finalizers passed
init-deploy passed
major-upgrade passed
monitoring passed
one-pod passed
operator-self-healing passed
pitr passed
scaling passed
scheduled-backup passed
self-healing 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: 4c4fa66
image: perconalab/percona-postgresql-operator:PR-911-4c4fa6690

@hors hors self-requested a review September 26, 2024 14:59
@hors hors merged commit 58f70d1 into main Sep 26, 2024
17 checks passed
@hors hors deleted the K8SPG-643 branch September 26, 2024 14:59
hors pushed a commit that referenced this pull request Sep 26, 2024
* K8SPG-643: Fix stanza-upgrade after major upgrade

* fix test ¯\_(ツ)_/¯

* increase timeouts
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.

4 participants