From 1ccd2a8e19cf5a45e67e6453dfb8eb5e27a3f4f9 Mon Sep 17 00:00:00 2001 From: Polina Bungina Date: Thu, 15 Feb 2024 22:02:51 +0100 Subject: [PATCH] Update Patroni to 3.2.2 --- postgres-appliance/Dockerfile | 2 +- postgres-appliance/bootstrap/maybe_pg_upgrade.py | 2 +- postgres-appliance/major_upgrade/inplace_upgrade.py | 2 +- postgres-appliance/major_upgrade/pg_upgrade.py | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/postgres-appliance/Dockerfile b/postgres-appliance/Dockerfile index 88d849fe4..2415cd7a9 100644 --- a/postgres-appliance/Dockerfile +++ b/postgres-appliance/Dockerfile @@ -77,7 +77,7 @@ COPY --from=dependencies-builder /builddeps/wal-g /usr/local/bin/ COPY build_scripts/patroni_wale.sh build_scripts/compress_build.sh /builddeps/ # Install patroni and wal-e -ENV PATRONIVERSION=3.1.2 +ENV PATRONIVERSION=3.2.2 ENV WALE_VERSION=1.1.1 WORKDIR / diff --git a/postgres-appliance/bootstrap/maybe_pg_upgrade.py b/postgres-appliance/bootstrap/maybe_pg_upgrade.py index b3d08e02e..b3e46cc5b 100644 --- a/postgres-appliance/bootstrap/maybe_pg_upgrade.py +++ b/postgres-appliance/bootstrap/maybe_pg_upgrade.py @@ -36,7 +36,7 @@ def wait_end_of_recovery(postgresql): for _ in polling_loop(postgresql.config.get('pg_ctl_timeout'), 10): postgresql.reset_cluster_info_state(None) - if postgresql.is_leader(): + if postgresql.is_primary(): break logger.info('waiting for end of recovery of the old cluster') diff --git a/postgres-appliance/major_upgrade/inplace_upgrade.py b/postgres-appliance/major_upgrade/inplace_upgrade.py index 2d4ade477..6ef10d797 100644 --- a/postgres-appliance/major_upgrade/inplace_upgrade.py +++ b/postgres-appliance/major_upgrade/inplace_upgrade.py @@ -490,7 +490,7 @@ def do_upgrade(self): self.cluster_version, self.desired_version) return True - if not (self.postgresql.is_running() and self.postgresql.is_leader()): + if not (self.postgresql.is_running() and self.postgresql.is_primary()): return logger.error('PostgreSQL is not running or in recovery') cluster = self.dcs.get_cluster() diff --git a/postgres-appliance/major_upgrade/pg_upgrade.py b/postgres-appliance/major_upgrade/pg_upgrade.py index 240c537e0..943d7dc33 100644 --- a/postgres-appliance/major_upgrade/pg_upgrade.py +++ b/postgres-appliance/major_upgrade/pg_upgrade.py @@ -58,7 +58,7 @@ def set_bin_dir(self, version): @property def local_conn_kwargs(self): - conn_kwargs = self.config.local_connect_kwargs + conn_kwargs = self.connection_pool.conn_kwargs conn_kwargs['options'] = '-c synchronous_commit=local -c statement_timeout=0 -c search_path=' conn_kwargs.pop('connect_timeout', None) return conn_kwargs @@ -195,10 +195,10 @@ def pg_upgrade(self, check=False): def prepare_new_pgdata(self, version): from spilo_commons import append_extensions - locale = self.query('SHOW lc_collate').fetchone()[0] - encoding = self.query('SHOW server_encoding').fetchone()[0] + locale = self.query('SHOW lc_collate')[0][0] + encoding = self.query('SHOW server_encoding')[0][0] initdb_config = [{'locale': locale}, {'encoding': encoding}] - if self.query("SELECT current_setting('data_checksums')::bool").fetchone()[0]: + if self.query("SELECT current_setting('data_checksums')::bool")[0][0]: initdb_config.append('data-checksums') logger.info('initdb config: %s', initdb_config)