This MR enables gitlab-ctl pg-upgrade
command to work on Patroni cluster nodes. On the leader node it upgrades PostgreSQL and wipes the cluster state from Consul and signal it to reinitialize. On replica nodes it deletes the data directory, upgrades PostgreSQL and joins the cluster. Patroni will use pg_basebackup
to resynchronize the replica.
This MR also adds to additional command arguments to pg-upgrade
. --leader
and --replica
will override automatic detection of the node role and change the upgrade procedure accordingly.
This seems to be excessive, esp. because it requires shutting down the cluster during upgrade (at least as long as the leader is upgrading) but it is currently the only way that it is possible, for example see https://github.com/zalando/patroni/issues/541#issuecomment-349229838
NOTE: This MR is blocked by !4548 (merged) and requires its changes to work properly.
NOTE: Documentation is in gitlab!41732 (merged).
pg-upgrade
. Reverting a successful upgrade with revert-pg-upgrade
will be problematic and requires manual reinitialization of the cluster. Given the complexity and risks involved we should not recommend using revert-pg-upgrade
and should encourage users to seek help from support.--replica
) or environment variable. Replica detection can be replaced with a heuristic to eliminate the need for parameter passing.Closes #5423 (closed)
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion
trigger-package
has a green pipeline running against latest commit