Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit48e0b8a

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 testpostmasters, so there is no need to create a TCP socket. Furthermore,doing so causes failures due to port conflicts if two builds are carriedout concurrently on one machine. (If the builds are done in differentchroots, which is standard practice at least in Red Hat distros, thereis no risk of conflict on the Unix socket.) Suppressing the TCP socketby setting listen_addresses to empty has long been standard practicefor pg_regress, and pg_upgrade knows about this too ... but pg_upgrade'stest.sh didn't get the memo.Back-patch to 9.2, and also sync the 9.2 version of the script with HEADas much as practical.
1 parentb4c99c9 commit48e0b8a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

‎contrib/pg_upgrade/test.sh

Lines changed: 15 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$testhostin
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
@@ -71,10 +78,11 @@ logdir=$PWD/log
7178
rm -rf"$logdir"
7279
mkdir"$logdir"
7380

81+
# enable echo so the user can see what is being executed
7482
set -x
7583

7684
$oldbindir/initdb
77-
$oldbindir/pg_ctl start -l"$logdir/postmaster1.log" -w
85+
$oldbindir/pg_ctl start -l"$logdir/postmaster1.log" -o"$POSTMASTER_OPTS" -w
7886
if"$MAKE" -C"$oldsrc" installcheck;then
7987
pg_dumpall -f"$temp_root"/dump1.sql|| pg_dumpall1_status=$?
8088
if ["$newsrc"!="$oldsrc" ];then
@@ -117,7 +125,7 @@ initdb
117125

118126
pg_upgrade -d"${PGDATA}.old" -D"${PGDATA}" -b"$oldbindir" -B"$bindir"
119127

120-
pg_ctl start -l"$logdir/postmaster2.log" -w
128+
pg_ctl start -l"$logdir/postmaster2.log" -o"$POSTMASTER_OPTS" -w
121129

122130
case$testhostin
123131
MINGW*)cmd /c analyze_new_cluster.bat ;;
@@ -126,6 +134,11 @@ esac
126134

127135
pg_dumpall -f"$temp_root"/dump2.sql|| pg_dumpall2_status=$?
128136
pg_ctl -m fast stop
137+
138+
# no need to echo commands anymore
139+
set +x
140+
echo
141+
129142
if [-n"$pg_dumpall2_status" ];then
130143
echo"pg_dumpall of post-upgrade database cluster failed"
131144
exit 1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp