8000 chore: wait a few seconds before an additional psql stop during upgra… · gofullthrottle/postgres@d090a1d · GitHub
[go: up one dir, main page]

Skip to content

Commit d090a1d

Browse files
authored
chore: wait a few seconds before an additional psql stop during upgrades (supabase#805)
1 parent 7c8ed2f commit d090a1d

File tree

1 file changed

+6
-0
lines changed
  • ansible/files/admin_api_scripts/pg_upgrade_scripts

1 file changed

+6
-0
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,15 @@ EOF
300300
UPGRADE_COMMAND="$UPGRADE_COMMAND --check"
301301
else
302302
echo "9. Stopping postgres; running pg_upgrade"
303+
304+
# Extra work to ensure postgres is actually stopped
305+
# Mostly needed for PG12 projects with odd systemd unit behavior
303306
retry 5 systemctl restart postgresql
304307
systemctl disable postgresql
305308
retry 5 systemctl stop postgresql
309+
310+
sleep 3
311+
systemctl stop postgresql
306312
fi
307313

308314
su -c "$UPGRADE_COMMAND" -s "$SHELL" postgres

0 commit comments

Comments
 (0)
0