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.
When operator (re)-start,
c.currentMajorVersion
will be 0. This value will be updated only if we executemajorVersionUpgrade
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 havelast-major-upgrade-failure
annotation. Hence, this cluster will never update itsc.currentMajorVersion
after operator restarts and will always be 0. Our e2e test couldn't catch this as we test thelast-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.