supabase-postgres.git / summary / log / commit / refs
commit 26bdc463a0d153fff52ee19e8e55368edf76317d
Author: Paul Cioanca <paul.cioanca@supabase.io>
Commit: GitHub <noreply@github.com>
Date: Wed Oct 02 11:57:12 2024 +0000
fix(pg_upgrade): retry commands within the cleanup step; wait until PG is ready to accept connections (#1251)
ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh
index c0a213d0..31a7cd5b 100755
--- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh
+++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh
@@ -120,20 +120,22 @@ cleanup() {
CI_start_postgres
fi
+ retry 8 pg_isready -h localhost -U supabase_admin
+
echo "Re-enabling extensions"
if [ -f $POST_UPGRADE_EXTENSION_SCRIPT ]; then
- run_sql -f $POST_UPGRADE_EXTENSION_SCRIPT
+ retry 5 run_sql -f $POST_UPGRADE_EXTENSION_SCRIPT
fi
echo "Removing SUPERUSER grant from postgres"
- run_sql -c "ALTER USER postgres WITH NOSUPERUSER;"
+ retry 5 run_sql -c "ALTER USER postgres WITH NOSUPERUSER;"
echo "Resetting postgres database connection limit"
- run_sql -c "ALTER DATABASE postgres CONNECTION LIMIT -1;"
+ retry 5 run_sql -c "ALTER DATABASE postgres CONNECTION LIMIT -1;"
if [ -z "$IS_CI" ] && [ -z "$IS_LOCAL_UPGRADE" ]; then
echo "Unmounting data disk from ${MOUNT_POINT}"
- umount $MOUNT_POINT
+ retry 3 umount $MOUNT_POINT
fi
echo "$UPGRADE_STATUS" > /tmp/pg-upgrade-status
[parent: 270c1c2f5417]