Skip to content

Conversation

@egegunes
Copy link
Contributor

@egegunes egegunes commented Oct 1, 2024

K8SPG-260 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
Pods get restarted after deploying 2.5.0 operator without changing crVersion.

Cause:
No version check in crunchy controllers.

Solution:
Add version checks.

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?

inelpandzic
inelpandzic previously approved these changes Oct 1, 2024
nmarukovich
nmarukovich previously approved these changes Oct 1, 2024
inelpandzic
inelpandzic previously approved these changes Oct 2, 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.

@egegunes pls check these failing tests.

hors
hors previously approved these changes Oct 3, 2024

for pod in $(kubectl get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
local phase=$(kubectl -n ${NAMESPACE} get ${pod} -o jsonpath={".status.phase"})
if [[ "${phase}" != "Running" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
if [[ "${phase}" != "Running" ]]; then
if [[ ${phase} != "Running" ]]; then

return cluster
}

const LabelVersion = "pgv2.percona.com/version"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you reuse this:

LabelVersion = perconaLabelPrefix + "version"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unfortunately, no. it causes cyclical import

@JNKPercona
Copy link
Collaborator

Test name Status
custom-extensions passed
custom-tls passed
demand-backup passed
finalizers passed
init-deploy passed
major-upgrade failure
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: 522c655
image: perconalab/percona-postgresql-operator:PR-918-522c655e6

@hors hors merged commit 42498eb into main Oct 3, 2024
7 checks passed
@hors hors deleted the fix-restart branch October 3, 2024 12:48
jvpasinatto pushed a commit that referenced this pull request Oct 3, 2024
* K8SPG-260: Fix restart after upgrade

* fix envtest

* Add cluster restart check to upgrade-minor tests

* K8SPG-643: Always try stanza-upgrade after a failed stanza-create

* fix upgrade-minor test

* improve major-upgrade

---------

Co-authored-by: Eleonora Zinchenko <eleonora.zinchenko@percona.com>
Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
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