Skip to content

Commit 78a5e73

Browse files
committed
Prevent creation of postmaster's TCP socket during pg_upgrade testing.
On non-Windows machines, we use the Unix socket for connections to test postmasters, so there is no need to create a TCP socket. Furthermore, doing so causes failures due to port conflicts if two builds are carried out concurrently on one machine. (If the builds are done in different chroots, which is standard practice at least in Red Hat distros, there is no risk of conflict on the Unix socket.) Suppressing the TCP socket by setting listen_addresses to empty has long been standard practice for pg_regress, and pg_upgrade knows about this too ... but pg_upgrade's test.sh didn't get the memo. Back-patch to 9.2, and also sync the 9.2 version of the script with HEAD as much as practical.
1 parent b0daba5 commit 78a5e73

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

contrib/pg_upgrade/test.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ export PGPORT
1717

1818
testhost=`uname -s`
1919

20+
case $testhost in
21+
MINGW*) LISTEN_ADDRESSES="localhost" ;;
22+
*) LISTEN_ADDRESSES="" ;;
23+
esac
24+
25+
POSTMASTER_OPTS="-F -c listen_addresses=$LISTEN_ADDRESSES"
26+
2027
temp_root=$PWD/tmp_check
2128

2229
if [ "$1" = '--install' ]; then
@@ -75,7 +82,7 @@ mkdir "$logdir"
7582
set -x
7683

7784
$oldbindir/initdb -N
78-
$oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -o '-F' -w
85+
$oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -o "$POSTMASTER_OPTS" -w
7986
if "$MAKE" -C "$oldsrc" installcheck; then
8087
pg_dumpall -f "$temp_root"/dump1.sql || pg_dumpall1_status=$?
8188
if [ "$newsrc" != "$oldsrc" ]; then
@@ -118,7 +125,7 @@ initdb -N
118125

119126
pg_upgrade -d "${PGDATA}.old" -D "${PGDATA}" -b "$oldbindir" -B "$bindir"
120127

121-
pg_ctl start -l "$logdir/postmaster2.log" -o '-F' -w
128+
pg_ctl start -l "$logdir/postmaster2.log" -o "$POSTMASTER_OPTS" -w
122129

123130
case $testhost in
124131
MINGW*) cmd /c analyze_new_cluster.bat ;;

0 commit comments

Comments
 (0)