Skip to content

Commit

Permalink
[bitnami/postgresql] Release postgresql-16.4.0-debian-12-r25 (#74787)
Browse files Browse the repository at this point in the history
Signed-off-by: Bitnami Bot <[email protected]>
  • Loading branch information
bitnami-bot authored Nov 12, 2024
1 parent 7ee1ee6 commit 73a0090
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bitnami/postgresql/16/debian-12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ ARG WITH_ALL_LOCALES="no"

LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
org.opencontainers.image.created="2024-11-09T23:15:29Z" \
org.opencontainers.image.created="2024-11-12T10:06:43Z" \
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/postgresql/README.md" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.ref.name="16.4.0-debian-12-r24" \
org.opencontainers.image.ref.name="16.4.0-debian-12-r25" \
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/postgresql" \
org.opencontainers.image.title="postgresql" \
org.opencontainers.image.vendor="Broadcom, Inc." \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,11 @@ postgresql_configure_replication_parameters() {
postgresql_set_property "wal_keep_segments" "12"
fi
postgresql_set_property "hot_standby" "on"

if is_boolean_yes "$POSTGRESQL_REPLICATION_USE_PASSFILE" && [[ ! -f "${POSTGRESQL_REPLICATION_PASSFILE_PATH}" ]]; then
echo "*:*:*:${POSTGRESQL_REPLICATION_USER}:${POSTGRESQL_REPLICATION_PASSWORD}" >"${POSTGRESQL_REPLICATION_PASSFILE_PATH}"
chmod 600 "${POSTGRESQL_REPLICATION_PASSFILE_PATH}"
fi
}

########################
Expand Down Expand Up @@ -924,6 +929,23 @@ postgresql_slave_init_db() {
done
}

########################
# Get postgresql replication user conninfo password method
# Globals:
# POSTGRESQL_*
# Arguments:
# None
# Returns:
# String
#########################
postgresql_replication_get_conninfo_password() {
if is_boolean_yes "$POSTGRESQL_REPLICATION_USE_PASSFILE"; then
echo "passfile=${POSTGRESQL_REPLICATION_PASSFILE_PATH}"
else
echo "password=${POSTGRESQL_REPLICATION_PASSWORD//\&/\\&}"
fi
}

########################
# Create recovery.conf in slave node
# Globals:
Expand All @@ -936,18 +958,17 @@ postgresql_slave_init_db() {
postgresql_configure_recovery() {
info "Setting up streaming replication slave..."

local -r escaped_password="${POSTGRESQL_REPLICATION_PASSWORD//\&/\\&}"
local -r psql_major_version="$(postgresql_get_major_version)"
if ((psql_major_version >= 12)); then
postgresql_set_property "primary_conninfo" "host=${POSTGRESQL_MASTER_HOST} port=${POSTGRESQL_MASTER_PORT_NUMBER} user=${POSTGRESQL_REPLICATION_USER} password=${escaped_password} application_name=${POSTGRESQL_CLUSTER_APP_NAME}" "$POSTGRESQL_CONF_FILE"
postgresql_set_property "primary_conninfo" "host=${POSTGRESQL_MASTER_HOST} port=${POSTGRESQL_MASTER_PORT_NUMBER} user=${POSTGRESQL_REPLICATION_USER} $(postgresql_replication_get_conninfo_password) application_name=${POSTGRESQL_CLUSTER_APP_NAME}" "$POSTGRESQL_CONF_FILE"
((psql_major_version < 16)) && postgresql_set_property "promote_trigger_file" "/tmp/postgresql.trigger.${POSTGRESQL_MASTER_PORT_NUMBER}" "$POSTGRESQL_CONF_FILE"
touch "$POSTGRESQL_DATA_DIR"/standby.signal
else
cp -f "$POSTGRESQL_BASE_DIR/share/recovery.conf.sample" "$POSTGRESQL_RECOVERY_FILE"
chmod 600 "$POSTGRESQL_RECOVERY_FILE"
am_i_root && chown "$POSTGRESQL_DAEMON_USER:$POSTGRESQL_DAEMON_GROUP" "$POSTGRESQL_RECOVERY_FILE"
postgresql_set_property "standby_mode" "on" "$POSTGRESQL_RECOVERY_FILE"
postgresql_set_property "primary_conninfo" "host=${POSTGRESQL_MASTER_HOST} port=${POSTGRESQL_MASTER_PORT_NUMBER} user=${POSTGRESQL_REPLICATION_USER} password=${escaped_password} application_name=${POSTGRESQL_CLUSTER_APP_NAME}" "$POSTGRESQL_RECOVERY_FILE"
postgresql_set_property "primary_conninfo" "host=${POSTGRESQL_MASTER_HOST} port=${POSTGRESQL_MASTER_PORT_NUMBER} user=${POSTGRESQL_REPLICATION_USER} $(postgresql_replication_get_conninfo_password) application_name=${POSTGRESQL_CLUSTER_APP_NAME}" "$POSTGRESQL_RECOVERY_FILE"
postgresql_set_property "trigger_file" "/tmp/postgresql.trigger.${POSTGRESQL_MASTER_PORT_NUMBER}" "$POSTGRESQL_RECOVERY_FILE"
fi
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ postgresql_env_vars=(
POSTGRESQL_ALLOW_REMOTE_CONNECTIONS
POSTGRESQL_REPLICATION_MODE
POSTGRESQL_REPLICATION_USER
POSTGRESQL_REPLICATION_PASSFILE_PATH
POSTGRESQL_SYNCHRONOUS_COMMIT_MODE
POSTGRESQL_FSYNC
POSTGRESQL_USERNAME
Expand Down Expand Up @@ -232,6 +233,7 @@ POSTGRESQL_REPLICATION_MODE="${POSTGRESQL_REPLICATION_MODE:-"${POSTGRES_REPLICAT
export POSTGRESQL_REPLICATION_MODE="${POSTGRESQL_REPLICATION_MODE:-master}"
POSTGRESQL_REPLICATION_USER="${POSTGRESQL_REPLICATION_USER:-"${POSTGRES_REPLICATION_USER:-}"}"
export POSTGRESQL_REPLICATION_USER="${POSTGRESQL_REPLICATION_USER:-}"
export POSTGRESQL_REPLICATION_PASSFILE_PATH="${POSTGRESQL_REPLICATION_PASSFILE_PATH:-${POSTGRESQL_CONF_DIR}/.pgpass}"
POSTGRESQL_SYNCHRONOUS_COMMIT_MODE="${POSTGRESQL_SYNCHRONOUS_COMMIT_MODE:-"${POSTGRES_SYNCHRONOUS_COMMIT_MODE:-}"}"
export POSTGRESQL_SYNCHRONOUS_COMMIT_MODE="${POSTGRESQL_SYNCHRONOUS_COMMIT_MODE:-on}"
POSTGRESQL_FSYNC="${POSTGRESQL_FSYNC:-"${POSTGRES_FSYNC:-}"}"
Expand Down

0 comments on commit 73a0090

Please sign in to comment.