Skip to content

Commit d4f6a14

Browse files
committed
Remove unnecessary repair code, now that Postgres is properly shutdown with SIGINT (see #2334)
1 parent 87bd4ff commit d4f6a14

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

jobs/postgres-10/templates/pre-start.erb

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,6 @@ fi
4848

4949
if [[ -f ${STORE_DIR}/fresh ]] ; then
5050
if [[ -d ${STORE_DIR_OLD} ]] ; then
51-
echo "checking status of postgres-9.4..."
52-
if ! "${PACKAGE_DIR_OLD}/bin/pg_controldata" "${STORE_DIR_OLD}" | grep -E "Database cluster state:\s+shut down"; then
53-
echo "postgres-9.4 did not shut down cleanly"
54-
echo "repairing postgres-9.4. cluster state..."
55-
56-
su - vcap -c "${PACKAGE_DIR_OLD}/bin/postgres -D ${STORE_DIR_OLD}" &
57-
postgres_pid=$!
58-
59-
count=0
60-
while ! "${PACKAGE_DIR_OLD}/bin/pg_isready" -t 30 -U postgres; do
61-
echo "waiting for postgres-9.4 to start..."
62-
sleep 1
63-
count=$(( count + 1 ))
64-
if [ $count -ge 120 ]; then
65-
echo "timed out waiting for postgres-9.4 to start"
66-
exit 1
67-
fi
68-
done
69-
70-
kill "${postgres_pid}"
71-
wait "${postgres_pid}"
72-
fi
73-
7451
echo "copying contents of postgres-9.4 to postgres-10 for postgres upgrade..."
7552
su - vcap -c "${PACKAGE_DIR}/bin/pg_upgrade \
7653
--old-bindir=${PACKAGE_DIR_OLD}/bin \

0 commit comments

Comments
 (0)