diff --git a/bitnami/postgresql-repmgr/9.6/debian-10/Dockerfile b/bitnami/postgresql-repmgr/9.6/debian-10/Dockerfile index 47ce4afb6b28..7c801299a5dc 100644 --- a/bitnami/postgresql-repmgr/9.6/debian-10/Dockerfile +++ b/bitnami/postgresql-repmgr/9.6/debian-10/Dockerfile @@ -24,7 +24,7 @@ COPY rootfs / RUN /opt/bitnami/scripts/postgresql-repmgr/postunpack.sh RUN /opt/bitnami/scripts/locales/add-extra-locales.sh ENV BITNAMI_APP_NAME="postgresql-repmgr" \ - BITNAMI_IMAGE_VERSION="9.6.19-debian-10-r50" \ + BITNAMI_IMAGE_VERSION="9.6.19-debian-10-r51" \ LANG="en_US.UTF-8" \ LANGUAGE="en_US:en" \ NSS_WRAPPER_LIB="/opt/bitnami/common/lib/libnss_wrapper.so" \ diff --git a/bitnami/postgresql-repmgr/9.6/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh b/bitnami/postgresql-repmgr/9.6/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh index 8a84090fc488..192ddf6b98ae 100644 --- a/bitnami/postgresql-repmgr/9.6/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh +++ b/bitnami/postgresql-repmgr/9.6/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh @@ -357,6 +357,20 @@ postgresql_create_replication_user() { echo "CREATE ROLE \"$POSTGRESQL_REPLICATION_USER\" REPLICATION LOGIN ENCRYPTED PASSWORD '$escaped_password'" | postgresql_execute } +######################## +# Return PostgreSQL major version +# Globals: +# POSTGRESQL_* +# Arguments: +# None +# Returns: +# String +######################### +postgresql_get_major_version() { + psql --version | grep -oE "[0-9]+\.[0-9]+" | grep -oE "^[0-9]+" +} + + ######################## # Change postgresql.conf by setting replication parameters # Globals: @@ -367,11 +381,16 @@ postgresql_create_replication_user() { # None ######################### postgresql_configure_replication_parameters() { + local -r psql_major_version="$(postgresql_get_major_version)" info "Configuring replication parameters" postgresql_set_property "wal_level" "hot_standby" postgresql_set_property "max_wal_size" "400MB" postgresql_set_property "max_wal_senders" "16" - postgresql_set_property "wal_keep_segments" "12" + if ((psql_major_version >= 13)); then + postgresql_set_property "wal_keep_size" "12" + else + postgresql_set_property "wal_keep_segments" "12" + fi postgresql_set_property "hot_standby" "on" if ((POSTGRESQL_NUM_SYNCHRONOUS_REPLICAS > 0)); then postgresql_set_property "synchronous_commit" "$POSTGRESQL_SYNCHRONOUS_COMMIT_MODE" @@ -885,18 +904,6 @@ postgresql_slave_init_db() { done } -######################## -# Return PostgreSQL major version -# Globals: -# POSTGRESQL_* -# Arguments: -# None -# Returns: -# String -######################### -postgresql_get_major_version() { - psql --version | grep -oE "[0-9]+\.[0-9]+" | grep -oE "^[0-9]+" -} ######################## # Create recovery.conf in slave node diff --git a/bitnami/postgresql-repmgr/README.md b/bitnami/postgresql-repmgr/README.md index aa55e58a4401..17f5d0e66ace 100644 --- a/bitnami/postgresql-repmgr/README.md +++ b/bitnami/postgresql-repmgr/README.md @@ -46,7 +46,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t * [`12`, `12-debian-10`, `12.4.0`, `12.4.0-debian-10-r50` (12/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/12.4.0-debian-10-r50/12/debian-10/Dockerfile) * [`11`, `11-debian-10`, `11.9.0`, `11.9.0-debian-10-r46`, `latest` (11/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/11.9.0-debian-10-r46/11/debian-10/Dockerfile) * [`10`, `10-debian-10`, `10.14.0`, `10.14.0-debian-10-r51` (10/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/10.14.0-debian-10-r51/10/debian-10/Dockerfile) -* [`9.6`, `9.6-debian-10`, `9.6.19`, `9.6.19-debian-10-r50` (9.6/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/9.6.19-debian-10-r50/9.6/debian-10/Dockerfile) +* [`9.6`, `9.6-debian-10`, `9.6.19`, `9.6.19-debian-10-r51` (9.6/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/9.6.19-debian-10-r51/9.6/debian-10/Dockerfile) Subscribe to project updates by watching the [bitnami/postgresql-repmgr GitHub repo](https://github.com/bitnami/bitnami-docker-postgresql-repmgr).