Skip to content

Commit

Permalink
Update Patroni to 3.2.2 (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcapet authored Feb 20, 2024
1 parent 5b12027 commit 00d2f54
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion postgres-appliance/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
2 changes: 1 addition & 1 deletion postgres-appliance/bootstrap/maybe_pg_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion postgres-appliance/major_upgrade/inplace_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions postgres-appliance/major_upgrade/pg_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 00d2f54

Please sign in to comment.