diff --git a/bitnami/postgresql-repmgr/12/debian-10/Dockerfile b/bitnami/postgresql-repmgr/12/debian-10/Dockerfile index 24c12de5246c..78f316da3766 100644 --- a/bitnami/postgresql-repmgr/12/debian-10/Dockerfile +++ b/bitnami/postgresql-repmgr/12/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="12.10.0-debian-10-r26" \ + BITNAMI_IMAGE_VERSION="12.10.0-debian-10-r27" \ 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/12/debian-10/rootfs/opt/bitnami/scripts/librepmgr.sh b/bitnami/postgresql-repmgr/12/debian-10/rootfs/opt/bitnami/scripts/librepmgr.sh index 8f4507962d64..abe1fea1c78c 100644 --- a/bitnami/postgresql-repmgr/12/debian-10/rootfs/opt/bitnami/scripts/librepmgr.sh +++ b/bitnami/postgresql-repmgr/12/debian-10/rootfs/opt/bitnami/scripts/librepmgr.sh @@ -495,7 +495,7 @@ pg_ctl_options='-o "--config-file=\"${POSTGRESQL_CONF_FILE}\" --external_pid_fil pg_basebackup_options='$waldir_option' EOF - if is_boolean_yes "$REPMGR_FENCE_OLD_PRIMARY"; then + if is_boolean_yes "$REPMGR_FENCE_OLD_PRIMARY"; then cat <>"${REPMGR_CONF_FILE}.tmp" child_nodes_disconnect_command='/bin/bash -c ". /opt/bitnami/scripts/libpostgresql.sh && . /opt/bitnami/scripts/postgresql-env.sh && postgresql_stop && kill -TERM 1"' EOF @@ -504,13 +504,32 @@ EOF child_nodes_check_interval=${REPMGR_CHILD_NODES_CHECK_INTERVAL} EOF fi - if [[ -v REPMGR_CHILD_NODES_CONNECTED_MIN_COUNT ]]; then cat <>"${REPMGR_CONF_FILE}.tmp" child_nodes_connected_min_count=${REPMGR_CHILD_NODES_CONNECTED_MIN_COUNT} EOF fi + if [[ -v REPMGR_CHILD_NODES_DISCONNECT_TIMEOUT ]]; then + cat <>"${REPMGR_CONF_FILE}.tmp" +child_nodes_disconnect_timeout=${REPMGR_CHILD_NODES_DISCONNECT_TIMEOUT} +EOF + fi + fi + if [[ "$REPMGR_FENCE_OLD_PRIMARY" == "true" ]]; then + cat <>"${REPMGR_CONF_FILE}.tmp" +child_nodes_disconnect_command='/bin/bash -c ". /opt/bitnami/scripts/libpostgresql.sh && . /opt/bitnami/scripts/postgresql-env.sh && postgresql_stop && kill -TERM 1"' +EOF + if [[ -v REPMGR_CHILD_NODES_CHECK_INTERVAL ]]; then + cat <>"${REPMGR_CONF_FILE}.tmp" +child_nodes_check_interval=${REPMGR_CHILD_NODES_CHECK_INTERVAL} +EOF + fi + if [[ -v REPMGR_CHILD_NODES_CONNECTED_MIN_COUNT ]]; then + cat <>"${REPMGR_CONF_FILE}.tmp" +child_nodes_connected_min_count=${REPMGR_CHILD_NODES_CONNECTED_MIN_COUNT} +EOF + fi if [[ -v REPMGR_CHILD_NODES_DISCONNECT_TIMEOUT ]]; then cat <>"${REPMGR_CONF_FILE}.tmp" child_nodes_disconnect_timeout=${REPMGR_CHILD_NODES_DISCONNECT_TIMEOUT} diff --git a/bitnami/postgresql-repmgr/12/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh b/bitnami/postgresql-repmgr/12/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh index 8d684864f812..71ca92515286 100644 --- a/bitnami/postgresql-repmgr/12/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh +++ b/bitnami/postgresql-repmgr/12/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh @@ -110,6 +110,10 @@ postgresql_env_vars=( REPMGR_MASTER_RESPONSE_TIMEOUT REPMGR_DEGRADED_MONITORING_TIMEOUT REPMGR_UPGRADE_EXTENSION + REPMGR_FENCE_OLD_PRIMARY + REPMGR_CHILD_NODES_CHECK_INTERVAL + REPMGR_CHILD_NODES_CONNECTED_MIN_COUNT + REPMGR_CHILD_NODES_DISCONNECT_TIMEOUT REPMGR_SWITCH_ROLE REPMGR_USERNAME REPMGR_DATABASE @@ -117,10 +121,6 @@ postgresql_env_vars=( REPMGR_PASSWORD REPMGR_USE_PASSFILE REPMGR_PASSFILE_PATH - REPMGR_FENCE_OLD_PRIMARY - REPMGR_CHILD_NODES_CHECK_INTERVAL - REPMGR_CHILD_NODES_CONNECTED_MIN_COUNT - REPMGR_CHILD_NODES_DISCONNECT_TIMEOUT PGCONNECT_TIMEOUT POSTGRESQL_REPLICATION_PASSFILE_PATH POSTGRES_DATA_DIR diff --git a/bitnami/postgresql-repmgr/README.md b/bitnami/postgresql-repmgr/README.md index b94c806dcb7f..c2b67c619182 100644 --- a/bitnami/postgresql-repmgr/README.md +++ b/bitnami/postgresql-repmgr/README.md @@ -51,7 +51,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t * [`14`, `14-debian-10`, `14.2.0`, `14.2.0-debian-10-r24`, `latest` (14/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/14.2.0-debian-10-r24/14/debian-10/Dockerfile) * [`13`, `13-debian-10`, `13.6.0`, `13.6.0-debian-10-r26` (13/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/13.6.0-debian-10-r26/13/debian-10/Dockerfile) -* [`12`, `12-debian-10`, `12.10.0`, `12.10.0-debian-10-r26` (12/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/12.10.0-debian-10-r26/12/debian-10/Dockerfile) +* [`12`, `12-debian-10`, `12.10.0`, `12.10.0-debian-10-r27` (12/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/12.10.0-debian-10-r27/12/debian-10/Dockerfile) * [`11`, `11-debian-10`, `11.15.0`, `11.15.0-debian-10-r26` (11/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/11.15.0-debian-10-r26/11/debian-10/Dockerfile) * [`10`, `10-debian-10`, `10.20.0`, `10.20.0-debian-10-r29` (10/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/10.20.0-debian-10-r29/10/debian-10/Dockerfile)