diff --git a/bitnami/postgresql/11/debian-10/Dockerfile b/bitnami/postgresql/11/debian-10/Dockerfile index 8f4d28e34c5e..44244e662ca4 100644 --- a/bitnami/postgresql/11/debian-10/Dockerfile +++ b/bitnami/postgresql/11/debian-10/Dockerfile @@ -9,8 +9,8 @@ ENV HOME="/" \ COPY prebuildfs / # Install required system packages and dependencies RUN install_packages acl ca-certificates curl gzip libbsd0 libbz2-1.0 libc6 libedit2 libffi6 libgcc1 libgmp10 libgnutls30 libhogweed4 libicu63 libidn2-0 libldap-2.4-2 liblz4-1 liblzma5 libncurses6 libnettle6 libp11-kit0 libpcre3 libreadline7 libsasl2-2 libsqlite3-0 libssl1.1 libstdc++6 libtasn1-6 libtinfo6 libunistring2 libuuid1 libxml2 libxslt1.1 libzstd1 locales procps tar zlib1g -RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "postgresql" "11.14.0-4" --checksum 73a254e25eeb54321d8e3274014090b5261140ab0050dfe54acbecc82b4c9c8f -RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.14.0-0" --checksum 3e6fc37ca073b10a73a804d39c2f0c028947a1a596382a4f8ebe43dfbaa3a25e +RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "postgresql" "11.14.0-5" --checksum 2bd6ef64215a7a71381d84bb594960ed11a3993d34907e672ace240fac38c2a8 +RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.14.0-1" --checksum 16f1a317859b06ae82e816b30f98f28b4707d18fe6cc3881bff535192a7715dc RUN chmod g+rwX /opt/bitnami RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8 RUN update-locale LANG=C.UTF-8 LC_MESSAGES=POSIX && \ @@ -22,7 +22,7 @@ COPY rootfs / RUN /opt/bitnami/scripts/postgresql/postunpack.sh RUN /opt/bitnami/scripts/locales/add-extra-locales.sh ENV BITNAMI_APP_NAME="postgresql" \ - BITNAMI_IMAGE_VERSION="11.14.0-debian-10-r27" \ + BITNAMI_IMAGE_VERSION="11.14.0-debian-10-r28" \ LANG="en_US.UTF-8" \ LANGUAGE="en_US:en" \ NSS_WRAPPER_LIB="/opt/bitnami/common/lib/libnss_wrapper.so" \ diff --git a/bitnami/postgresql/11/debian-10/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/postgresql/11/debian-10/prebuildfs/opt/bitnami/.bitnami_components.json index a912694a040b..738345ffdec7 100644 --- a/bitnami/postgresql/11/debian-10/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/postgresql/11/debian-10/prebuildfs/opt/bitnami/.bitnami_components.json @@ -1,16 +1,16 @@ { "gosu": { "arch": "amd64", - "digest": "3e6fc37ca073b10a73a804d39c2f0c028947a1a596382a4f8ebe43dfbaa3a25e", + "digest": "16f1a317859b06ae82e816b30f98f28b4707d18fe6cc3881bff535192a7715dc", "distro": "debian-10", "type": "NAMI", - "version": "1.14.0-0" + "version": "1.14.0-1" }, "postgresql": { "arch": "amd64", - "digest": "73a254e25eeb54321d8e3274014090b5261140ab0050dfe54acbecc82b4c9c8f", + "digest": "2bd6ef64215a7a71381d84bb594960ed11a3993d34907e672ace240fac38c2a8", "distro": "debian-10", "type": "NAMI", - "version": "11.14.0-4" + "version": "11.14.0-5" } } \ No newline at end of file diff --git a/bitnami/postgresql/11/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh b/bitnami/postgresql/11/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh index e838fbff75ce..9fea03c2f007 100644 --- a/bitnami/postgresql/11/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh +++ b/bitnami/postgresql/11/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh @@ -11,6 +11,7 @@ . /opt/bitnami/scripts/libos.sh . /opt/bitnami/scripts/libservice.sh . /opt/bitnami/scripts/libvalidations.sh +. /opt/bitnami/scripts/libnet.sh ######################## # Configure libnss_wrapper so PostgreSQL commands work with a random user. @@ -388,9 +389,27 @@ postgresql_configure_replication_parameters() { # None ######################### postgresql_configure_synchronous_replication() { + local replication_nodes="" + info "Configuring synchronous_replication" + + # Check for comma separate values + # When using repmgr, POSTGRESQL_CLUSTER_APP_NAME will contain the list of nodes to be synchronous + # This list need to cleaned from other things but node names. + if [[ "$POSTGRESQL_CLUSTER_APP_NAME" == *","* ]]; then + read -r -a nodes <<<"$(tr ',;' ' ' <<<"${POSTGRESQL_CLUSTER_APP_NAME}")" + for node in "${nodes[@]}"; do + [[ "$node" =~ ^(([^:/?#]+):)?// ]] || node="tcp://${node}" + + host="$(parse_uri "$node" 'host')" + replication_nodes="${replication_nodes}${replication_nodes:+,}\"${host}\"" + done + else + replication_nodes="\"${POSTGRESQL_CLUSTER_APP_NAME}\"" + fi + if ((POSTGRESQL_NUM_SYNCHRONOUS_REPLICAS > 0)); then postgresql_set_property "synchronous_commit" "$POSTGRESQL_SYNCHRONOUS_COMMIT_MODE" - postgresql_set_property "synchronous_standby_names" "${POSTGRESQL_NUM_SYNCHRONOUS_REPLICAS} (\"${POSTGRESQL_CLUSTER_APP_NAME}\")" + postgresql_set_property "synchronous_standby_names" "${POSTGRESQL_NUM_SYNCHRONOUS_REPLICAS} (${replication_nodes})" fi } diff --git a/bitnami/postgresql/README.md b/bitnami/postgresql/README.md index 9fa0a9ebcffd..eb0a3c4059f9 100644 --- a/bitnami/postgresql/README.md +++ b/bitnami/postgresql/README.md @@ -53,7 +53,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t * [`14`, `14-debian-10`, `14.1.0`, `14.1.0-debian-10-r57` (14/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/14.1.0-debian-10-r57/14/debian-10/Dockerfile) * [`13`, `13-debian-10`, `13.5.0`, `13.5.0-debian-10-r57` (13/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/13.5.0-debian-10-r57/13/debian-10/Dockerfile) * [`12`, `12-debian-10`, `12.9.0`, `12.9.0-debian-10-r57` (12/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/12.9.0-debian-10-r57/12/debian-10/Dockerfile) -* [`11`, `11-debian-10`, `11.14.0`, `11.14.0-debian-10-r27`, `latest` (11/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/11.14.0-debian-10-r27/11/debian-10/Dockerfile) +* [`11`, `11-debian-10`, `11.14.0`, `11.14.0-debian-10-r28`, `latest` (11/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/11.14.0-debian-10-r28/11/debian-10/Dockerfile) * [`10`, `10-debian-10`, `10.19.0`, `10.19.0-debian-10-r59` (10/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/10.19.0-debian-10-r59/10/debian-10/Dockerfile) * [`9.6`, `9.6-debian-10`, `9.6.24`, `9.6.24-debian-10-r57` (9.6/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/9.6.24-debian-10-r57/9.6/debian-10/Dockerfile)