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 6fa9e31f5..bf558dfd4 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 d7087da3a..ba56b2156 100644 --- a/postgres-appliance/major_upgrade/pg_upgrade.py +++ b/postgres-appliance/major_upgrade/pg_upgrade.py @@ -62,7 +62,7 @@ def set_bin_dir(self, bin_dir): @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 @@ -203,10 +203,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)