Upgrade to Patroni 4.0.5 or later
Overview
patroni should be upgraded to 4.0.5. This is the first version to support python 3.13.7 and is a requirement to upgrade omnibus-gitlab's python version.
Context
Python 3.9 is EOL and Patroni got support for 3.13 in 4.0.5.
This will require significant effort. The patch notes mention specific difficulty in the migration. omnibus-gitlab also has gitlab-ctl commands that reference the now-deprecated master:
grep -R master files/gitlab-ctl-commands-ee/lib/patroni.rb
files/gitlab-ctl-commands-ee/lib/patroni.rb: opts.on('--master [MASTER]', 'The name of the current master') do |m|
files/gitlab-ctl-commands-ee/lib/patroni.rb: options[:master] = m
files/gitlab-ctl-commands-ee/lib/patroni.rb: opts.on('--master [MASTER]', 'The name of the current master') do |m|
files/gitlab-ctl-commands-ee/lib/patroni.rb: options[:master] = m
files/gitlab-ctl-commands-ee/lib/patroni.rb: command << "--master #{options[:master]}" if options[:master]
files/gitlab-ctl-commands-ee/lib/patroni.rb: command << "--master #{options[:master]}" if options[:master]
Upstream breaking changes in 4.0.0+ versions
Breaking changes
- The following breaking changes were introduced when getting rid of the non-inclusive “master” term in the Patroni code:
- On Kubernetes, Patroni by default will set
rolelabel toprimary. In case if you want to keep the old behavior and avoid downtime or lengthy complex migrations, you can configure parameterskubernetes.leader_label_valueandkubernetes.standby_leader_label_valuetomaster. Read more here.- Patroni role is written to DCS as
primaryinstead ofmaster.- Patroni role returned by Patroni REST API has been changed from
mastertoprimary.- Patroni REST API no longer accepts role=master in requests to
/switchover,/failover,/restartendpoints./metricsREST API endpoint will no longer reportpatroni_mastermetric.patronictlno longer accepts--masteroption for any command.--leaderor--primaryoptions should be used instead.- no_master option in the declarative configuration of custom replica creation methods is no longer treated as a special option, please use
no_leaderinstead.patroni_wale_restorescript doesn’t accept--no_masteroption anymore.patroni_barmanscript doesn’t accept--role=masteroption anymore.- All callback scripts are executed with
role=primaryoption passed instead ofrole=master.patronictl failoverdoes not accept--leaderoption that was deprecated since Patroni 3.2.0.- User creation functionality (
bootstrap.usersconfiguration section) deprecated since Patroni 3.2.0 has been removed.
Deliverables
-
Update Patroni to the most recent verison possible without incurring breaking changes to our users to avoid more delays of the Python 3.13 upgrade. -
Confirm upgrade to this version does not break existing database clusters. -
Patroni for in primary cluster. -
Patroni works in the secondary / geo cluster.
-
-
Confirm fresh installation with this version works. -
Confirm Patroni Failover works. -
Failover in an upgraded installation. -
Failover in a fresh installation.
-
-
Validate prometheus metrics changes.
Edited by Nailia Iskhakova