9.6.17-debian-10-r15 release

This commit is contained in:
Bitnami Bot 2020-02-27 12:09:18 +00:00
parent 0551947280
commit 16a0e8f40b
3 changed files with 23 additions and 22 deletions

View File

@ -22,7 +22,7 @@ RUN echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen
COPY rootfs /
RUN /postunpack.sh
ENV BITNAMI_APP_NAME="postgresql-repmgr" \
BITNAMI_IMAGE_VERSION="9.6.17-debian-10-r14" \
BITNAMI_IMAGE_VERSION="9.6.17-debian-10-r15" \
LANG="en_US.UTF-8" \
LANGUAGE="en_US:en" \
NAMI_PREFIX="/.nami" \

View File

@ -188,6 +188,9 @@ repmgr_get_upstream_node() {
local primary_conninfo
local pretending_primary_host=""
local pretending_primary_port=""
local host=""
local port=""
if [[ -n "$REPMGR_PARTNER_NODES" ]]; then
repmgr_info "Querying all partner nodes for common upstream node..."
@ -195,13 +198,13 @@ repmgr_get_upstream_node() {
for node in "${nodes[@]}"; do
# intentionally accept inncorect address (without [schema:]// )
[[ "$node" =~ ^(([^:/?#]+):)?// ]] || node="tcp://${node}"
local host=$(parse_uri "$node" 'host')
local port=$(parse_uri "$node" 'port')
port=${port:-$REPMGR_PRIMARY_PORT}
repmgr_debug "Checking node $host:$port..."
host="$(parse_uri "$node" 'host')"
port="$(parse_uri "$node" 'port')"
port="${port:-$REPMGR_PRIMARY_PORT}"
repmgr_debug "Checking node '$host:$port'..."
local query="SELECT conninfo FROM repmgr.show_nodes WHERE (upstream_node_name IS NULL OR upstream_node_name = '') AND active=true"
if ! primary_conninfo="$(echo "$query" | NO_ERRORS=true postgresql_execute "$REPMGR_DATABASE" "$REPMGR_USERNAME" "$REPMGR_PASSWORD" "$host" "$port" "-tA")"; then
repmgr_debug "Skipping: failed to get primary from the node $host:$port!"
repmgr_debug "Skipping: failed to get primary from the node '$host:$port'!"
continue
elif [[ -z "$primary_conninfo" ]]; then
repmgr_debug "Skipping: failed to get information about primary nodes!"
@ -209,19 +212,19 @@ repmgr_get_upstream_node() {
elif [[ "$(echo "$primary_conninfo" | wc -l)" -eq 1 ]]; then
local -r suggested_primary_host="$(echo "$primary_conninfo" | awk -F 'host=' '{print $2}' | awk '{print $1}')"
local -r suggested_primary_port="$(echo "$primary_conninfo" | awk -F 'port=' '{print $2}' | awk '{print $1}')"
repmgr_debug "Pretending primary role node - ${suggested_primary_host},${suggested_primary_port}"
repmgr_debug "Pretending primary role node - '${suggested_primary_host}:${suggested_primary_port}'"
if [[ -n "$pretending_primary_host" ]]; then
if [[ "${pretending_primary_host},${pretending_primary_port}" != "${suggested_primary_host},${suggested_primary_port}" ]]; then
repmgr_warn "Conflict of pretending primary role nodes (previously: $pretending_primary_host,$pretending_primary_port, now: $suggested_primary_host,$suggested_primary_port)"
if [[ "${pretending_primary_host}:${pretending_primary_port}" != "${suggested_primary_host}:${suggested_primary_port}" ]]; then
repmgr_warn "Conflict of pretending primary role nodes (previously: '${pretending_primary_host}:${pretending_primary_port}', now: '${suggested_primary_host}:${suggested_primary_port}')"
pretending_primary_host="" && pretending_primary_port="" && break
fi
else
repmgr_debug "Pretending primary set to $suggested_primary_host,$suggested_primary_port!"
repmgr_debug "Pretending primary set to '${suggested_primary_host}:${suggested_primary_port}'!"
pretending_primary_host="$suggested_primary_host"
pretending_primary_port="$suggested_primary_port"
fi
else
repmgr_warn "There were more than one primary when getting primary from node $host:$port"
repmgr_warn "There were more than one primary when getting primary from node '$host:$port'"
pretending_primary_host="" && pretending_primary_port="" && break
fi
done
@ -250,17 +253,15 @@ repmgr_get_primary_node() {
readarray -t upstream_node < <(repmgr_get_upstream_node)
upstream_host=${upstream_node[0]}
upstream_port=${upstream_node[1]:-$REPMGR_PRIMARY_PORT}
[[ -n "$upstream_host" ]] && repmgr_info "Auto-detected primary node: '$upstream_host,$upstream_port'"
[[ -n "$upstream_host" ]] && repmgr_info "Auto-detected primary node: '${upstream_host}:${upstream_port}'"
if [[ -f "$REPMGR_PRIMARY_ROLE_LOCK_FILE_NAME" ]]; then
repmgr_info "This node was acting as a primary before restart!"
if [[ -z "$upstream_host" ]] || [[ "$upstream_host,$upstream_port" = "$REPMGR_NODE_NETWORK_NAME,$REPMGR_PORT_NUMBER" ]]; then
if [[ -z "$upstream_host" ]] || [[ "${upstream_host}:${upstream_port}" = "${REPMGR_NODE_NETWORK_NAME}:${REPMGR_PORT_NUMBER}" ]]; then
repmgr_info "Can not find new primary. Starting PostgreSQL normally..."
else
repmgr_info "Current master is $upstream_host,$upstream_port. Cloning/rewinding it and acting as a standby node..."
repmgr_info "Current master is '${upstream_host}:${upstream_port}'. Cloning/rewinding it and acting as a standby node..."
rm -f "$REPMGR_PRIMARY_ROLE_LOCK_FILE_NAME"
export REPMGR_SWITCH_ROLE="yes"
primary_host="$upstream_host"
@ -268,7 +269,7 @@ repmgr_get_primary_node() {
fi
else
if [[ -z "$upstream_host" ]]; then
if [[ "$REPMGR_PRIMARY_HOST,$REPMGR_PRIMARY_PORT" != "$REPMGR_NODE_NETWORK_NAME,$REPMGR_PORT_NUMBER" ]]; then
if [[ "${REPMGR_PRIMARY_HOST}:${REPMGR_PRIMARY_PORT}" != "${REPMGR_NODE_NETWORK_NAME}:${REPMGR_PORT_NUMBER}" ]]; then
primary_host="$REPMGR_PRIMARY_HOST"
primary_port="$REPMGR_PRIMARY_PORT"
fi
@ -278,7 +279,7 @@ repmgr_get_primary_node() {
fi
fi
[[ -n "$primary_host" ]] && repmgr_debug "Primary node: $primary_host,$primary_port"
[[ -n "$primary_host" ]] && repmgr_debug "Primary node: '${primary_host}:${primary_port}'"
echo "$primary_host"
echo "$primary_port"
}
@ -511,11 +512,11 @@ repmgr_wait_primary_node() {
local -i max_tries=$(( timeout / step ))
local schemata
repmgr_info "Waiting for primary node..."
repmgr_debug "Wait for schema $REPMGR_DATABASE.repmgr on $REPMGR_CURRENT_PRIMARY_HOST:$REPMGR_CURRENT_PRIMARY_PORT, will try $max_tries times with $step delay seconds (TIMEOUT=$timeout)"
repmgr_debug "Wait for schema $REPMGR_DATABASE.repmgr on '${REPMGR_CURRENT_PRIMARY_HOST}:${REPMGR_CURRENT_PRIMARY_PORT}', will try $max_tries times with $step delay seconds (TIMEOUT=$timeout)"
for ((i = 0 ; i <= timeout ; i+=step )); do
local query="SELECT 1 FROM information_schema.schemata WHERE catalog_name='$REPMGR_DATABASE' AND schema_name='repmgr'"
if ! schemata="$(echo "$query" | NO_ERRORS=true postgresql_execute "$REPMGR_DATABASE" "$REPMGR_USERNAME" "$REPMGR_PASSWORD" "$REPMGR_CURRENT_PRIMARY_HOST" "$REPMGR_CURRENT_PRIMARY_PORT" "-tA")"; then
repmgr_debug "Host $REPMGR_CURRENT_PRIMARY_HOST:$REPMGR_CURRENT_PRIMARY_PORT is not accessible"
repmgr_debug "Host '${REPMGR_CURRENT_PRIMARY_HOST}:${REPMGR_CURRENT_PRIMARY_PORT}' is not accessible"
else
if [[ $schemata -ne 1 ]]; then
repmgr_debug "Schema $REPMGR_DATABASE.repmgr is still not accessible"
@ -640,7 +641,7 @@ repmgr_upgrade_extension() {
# None
#########################
repmgr_initialize() {
repmgr_debug "Node ID: $(repmgr_get_node_id), Rol: $REPMGR_ROLE, Primary Node: $REPMGR_CURRENT_PRIMARY_HOST:$REPMGR_CURRENT_PRIMARY_PORT"
repmgr_debug "Node ID: '$(repmgr_get_node_id)', Rol: '$REPMGR_ROLE', Primary Node: '${REPMGR_CURRENT_PRIMARY_HOST}:${REPMGR_CURRENT_PRIMARY_PORT}'"
repmgr_info "Initializing Repmgr..."
if [[ "$REPMGR_ROLE" = "standby" ]]; then

View File

@ -46,7 +46,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t
* [`12-debian-10`, `12.2.0-debian-10-r14`, `12`, `12.2.0` (12/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/12.2.0-debian-10-r14/12/debian-10/Dockerfile)
* [`11-debian-10`, `11.7.0-debian-10-r14`, `11`, `11.7.0`, `latest` (11/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/11.7.0-debian-10-r14/11/debian-10/Dockerfile)
* [`10-debian-10`, `10.12.0-debian-10-r14`, `10`, `10.12.0` (10/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/10.12.0-debian-10-r14/10/debian-10/Dockerfile)
* [`9.6-debian-10`, `9.6.17-debian-10-r14`, `9.6`, `9.6.17` (9.6/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/9.6.17-debian-10-r14/9.6/debian-10/Dockerfile)
* [`9.6-debian-10`, `9.6.17-debian-10-r15`, `9.6`, `9.6.17` (9.6/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/9.6.17-debian-10-r15/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).