From f5c7da32cbea809a7d062377d8de2a3c0bb0ab75 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Fri, 28 Aug 2026 14:00:22 +0600 Subject: [PATCH] Use $HOSTNAME in restore.sh instead of the hostname binary restore.sh is the only script in this repo that shells out to hostname; every other one uses $HOSTNAME. The hostname binary is not installed in the RHEL/CentOS Stream based images that run this script, so HOST came back empty. The script has no set -e, so it carried on: the [[ "$HOST" =~ -0$ ]] test was false on every pod, ordinal 0 got recovery_target_action = 'pause' instead of 'promote', and the script then waited forever on pg_is_wal_replay_paused() for a node that was supposed to promote. Signed-off-by: Tamal Saha --- scripts/restore.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/restore.sh b/scripts/restore.sh index a5c7723..8361229 100755 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -2,7 +2,9 @@ LOG_DIR="$PGDATA"/log LOG_FILE_PATTERN="postgresql-*.log" -HOST=$(hostname) +# bash sets HOSTNAME itself; the hostname binary is absent from the RHEL/CentOS +# Stream based images, and without it every pod would take the replica path below. +HOST="$HOSTNAME" mkdir -p $PGDATA chmod 0700 "$PGDATA"