test_upgrade: pass PGPORT explicitly for local builds
Concourse uses the default port, but for local builds we can't assume
that.
@@ -42,6 +42,8 @@ load_old_db_data() {
psql_opts=
fi
+ psql_opts+=" ${PSQL_ADDOPTS}"
+
echo 'Loading test database...'
scp "$dumpfile" ${MASTER_HOST}:/tmp/dump.sql.xz
@@ -57,7 +59,7 @@ dump_cluster() {
ssh -n ${MASTER_HOST} "
source ${NEW_GPHOME}/greenplum_path.sh
- pg_dumpall -f '$dumpfile'
+ pg_dumpall -f '$dumpfile' ${PSQL_ADDOPTS}
"
}
@@ -185,7 +187,7 @@ dump_old_master_query() {
# run on the old master, pre-upgrade.
ssh -n ${MASTER_HOST} '
source '"${OLD_GPHOME}"'/greenplum_path.sh
- psql postgres --quiet --no-align --tuples-only -F"'$'\t''" -c "'$1'"
+ psql postgres '"${PSQL_ADDOPTS}"' --quiet --no-align --tuples-only -F"'$'\t''" -c "'$1'"
'
}
@@ -229,6 +231,8 @@ apply_sql_fixups() {
psql_opts+=" -q"
fi
+ psql_opts+=" ${PSQL_ADDOPTS}"
+
echo 'Finalizing upgrade...'
# FIXME: we need a generic way for gp_upgrade to figure out which SQL fixup
@@ -311,6 +315,7 @@ if (( $CONCOURSE_MODE )); then
DATADIR_PREFIX=/data/gpdata
OLD_MASTER_DATA_DIRECTORY=/data/gpdata/master/gpseg-1
NEW_MASTER_DATA_DIRECTORY=/data/gpdata/master-new/gpseg-1
+ PSQL_ADDOPTS=
GPINITSYSTEM_CONFIG=gpinitsystem_config
GPINITSYSTEM_HOSTFILE=segment_host_list
else
@@ -320,6 +325,7 @@ else
DATADIR_PREFIX=$(dirname $(dirname ${MASTER_DATA_DIRECTORY}))
OLD_MASTER_DATA_DIRECTORY=${MASTER_DATA_DIRECTORY}
NEW_MASTER_DATA_DIRECTORY=$(get_new_datadir "${MASTER_DATA_DIRECTORY}")
+ PSQL_ADDOPTS="-p ${PGPORT}"
GPINITSYSTEM_CONFIG=$(dirname ${DATADIR_PREFIX})/clusterConfigFile
GPINITSYSTEM_HOSTFILE=$(dirname ${DATADIR_PREFIX})/hostfile
fi
