zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.37k stars 980 forks source link

Bugfix: skip upgrade when failed annotation should happen after recheck version #2755

Closed idanovinda closed 2 months ago

idanovinda commented 2 months ago

When operator (re)-start, c.currentMajorVersion will be 0. This value will be updated only if we execute majorVersionUpgrade until the part where we get the current version from the Patroni. In #2727, we skipped the part where we do update this value when a cluster have last-major-upgrade-failure annotation. Hence, this cluster will never update its c.currentMajorVersion after operator restarts and will always be 0. Our e2e test couldn't catch this as we test the last-major-upgrade-failure after doing some upgrades.

Solution

We should only skip the upgrade of the failure upgrade only after we make sure that the recheck is done.

idanovinda commented 2 months ago

👍

FxKu commented 2 months ago

:+1: