diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2013-01-03 18:34:57 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2013-01-03 18:34:57 -0500 |
commit | 48e0b8a23e3c6e095333a6d489d3f7771d28d383 (patch) | |
tree | 68f1d16309c4087177664c113daf1a41d1c3348e | |
parent | b4c99c9af379157a6224b0a4c01da22192633adf (diff) | |
download | postgresql-48e0b8a23e3c6e095333a6d489d3f7771d28d383.tar.gz postgresql-48e0b8a23e3c6e095333a6d489d3f7771d28d383.zip |
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.
-rw-r--r-- | contrib/pg_upgrade/test.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/contrib/pg_upgrade/test.sh b/contrib/pg_upgrade/test.sh index e9d159e5e80..41355cf5fdc 100644 --- a/contrib/pg_upgrade/test.sh +++ b/contrib/pg_upgrade/test.sh @@ -17,6 +17,13 @@ export PGPORT testhost=`uname -s` +case $testhost in + MINGW*) LISTEN_ADDRESSES="localhost" ;; + *) LISTEN_ADDRESSES="" ;; +esac + +POSTMASTER_OPTS="-F -c listen_addresses=$LISTEN_ADDRESSES" + temp_root=$PWD/tmp_check if [ "$1" = '--install' ]; then @@ -71,10 +78,11 @@ logdir=$PWD/log rm -rf "$logdir" mkdir "$logdir" +# enable echo so the user can see what is being executed set -x $oldbindir/initdb -$oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -w +$oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -o "$POSTMASTER_OPTS" -w if "$MAKE" -C "$oldsrc" installcheck; then pg_dumpall -f "$temp_root"/dump1.sql || pg_dumpall1_status=$? if [ "$newsrc" != "$oldsrc" ]; then @@ -117,7 +125,7 @@ initdb pg_upgrade -d "${PGDATA}.old" -D "${PGDATA}" -b "$oldbindir" -B "$bindir" -pg_ctl start -l "$logdir/postmaster2.log" -w +pg_ctl start -l "$logdir/postmaster2.log" -o "$POSTMASTER_OPTS" -w case $testhost in MINGW*) cmd /c analyze_new_cluster.bat ;; @@ -126,6 +134,11 @@ esac pg_dumpall -f "$temp_root"/dump2.sql || pg_dumpall2_status=$? pg_ctl -m fast stop + +# no need to echo commands anymore +set +x +echo + if [ -n "$pg_dumpall2_status" ]; then echo "pg_dumpall of post-upgrade database cluster failed" exit 1 |