diff --git a/bitnami/postgresql-repmgr/17/debian-12/Dockerfile b/bitnami/postgresql-repmgr/17/debian-12/Dockerfile index 0507e45c70447..507745b7bc268 100644 --- a/bitnami/postgresql-repmgr/17/debian-12/Dockerfile +++ b/bitnami/postgresql-repmgr/17/debian-12/Dockerfile @@ -8,11 +8,10 @@ ARG TARGETARCH LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \ org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \ - org.opencontainers.image.created="2025-03-03T21:37:17Z" \ + org.opencontainers.image.created="2025-03-15T18:40:55Z" \ org.opencontainers.image.description="Application packaged by Broadcom, Inc." \ org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/postgresql-repmgr/README.md" \ - org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="17.4.0-debian-12-r5" \ + org.opencontainers.image.ref.name="17.4.0-debian-12-r6" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/postgresql-repmgr" \ org.opencontainers.image.title="postgresql-repmgr" \ org.opencontainers.image.vendor="Broadcom, Inc." \ diff --git a/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh b/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh index d381fe6074c98..7180138d5dd98 100644 --- a/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh +++ b/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh @@ -572,9 +572,13 @@ postgresql_clean_from_restart() { local -r -a files=( "$POSTGRESQL_DATA_DIR"/postmaster.pid "$POSTGRESQL_DATA_DIR"/standby.signal - "$POSTGRESQL_DATA_DIR"/recovery.signal ) + # Enable recovery only when POSTGRESQL_PERFORM_RESTORE feature flag is set + if ! is_boolean_yes "$POSTGRESQL_PERFORM_RESTORE" ; then + files+=("$POSTGRESQL_DATA_DIR"/recovery.signal) + fi + for file in "${files[@]}"; do if [[ -f "$file" ]]; then info "Cleaning stale $file file" diff --git a/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh b/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh index 9e2a51d67024c..6623765bb2959 100644 --- a/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh +++ b/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh @@ -95,6 +95,7 @@ postgresql_env_vars=( POSTGRESQL_DEFAULT_TOAST_COMPRESSION POSTGRESQL_PASSWORD_ENCRYPTION POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION + POSTGRESQL_PERFORM_RESTORE POSTGRESQL_AUTOCTL_CONF_DIR POSTGRESQL_AUTOCTL_MODE POSTGRESQL_AUTOCTL_MONITOR_HOST @@ -374,6 +375,9 @@ export POSTGRESQL_PASSWORD_ENCRYPTION="${POSTGRESQL_PASSWORD_ENCRYPTION:-}" export POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION="${POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION:-}" export POSTGRESQL_USE_CUSTOM_PGHBA_INITIALIZATION="no" +# Native recovery settings +export POSTGRESQL_PERFORM_RESTORE="${POSTGRESQL_PERFORM_RESTORE:-no}" + # pgAutoFailover settings export POSTGRESQL_AUTOCTL_VOLUME_DIR="${POSTGRESQL_VOLUME_DIR}/pgautoctl" export POSTGRESQL_AUTOCTL_CONF_DIR="${POSTGRESQL_AUTOCTL_CONF_DIR:-${POSTGRESQL_AUTOCTL_VOLUME_DIR}/.config}" diff --git a/bitnami/postgresql-repmgr/README.md b/bitnami/postgresql-repmgr/README.md index 1ff090f75789e..477c995a2071f 100644 --- a/bitnami/postgresql-repmgr/README.md +++ b/bitnami/postgresql-repmgr/README.md @@ -621,6 +621,7 @@ Refer to [issues/27124](https://github.com/bitnami/containers/issues/27124) for | `POSTGRESQL_DEFAULT_TOAST_COMPRESSION` | Set the postgres default compression | `nil` | | `POSTGRESQL_PASSWORD_ENCRYPTION` | Set the passwords encryption method | `nil` | | `POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION` | Set transaction isolation | `nil` | +| `POSTGRESQL_PERFORM_RESTORE` | Flag to skip deletion of `recovery.signal` file to enable native recovery. e.g by using `wal-g` | `no` | | `POSTGRESQL_AUTOCTL_CONF_DIR` | Path to the configuration dir for the pg_autoctl command | `${POSTGRESQL_AUTOCTL_VOLUME_DIR}/.config` | | `POSTGRESQL_AUTOCTL_MODE` | pgAutoFailover node type, valid values [monitor, postgres] | `postgres` | | `POSTGRESQL_AUTOCTL_MONITOR_HOST` | Hostname for the monitor component | `monitor` |