Skip to content

Commit 481f1da

Browse files
committed
Merge branch 'release/15.6' into pcnc/wrappers-15.6
2 parents 989415b + 5e986bb commit 481f1da

File tree

1 file changed

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

1 file changed

+8
-6
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,22 @@ cleanup() {
120120
CI_start_postgres
121121
fi
122122

123+
retry 8 pg_isready -h localhost -U supabase_admin
124+
123125
echo "Re-enabling extensions"
124126
if [ -f $POST_UPGRADE_EXTENSION_SCRIPT ]; then
125-
run_sql -f $POST_UPGRADE_EXTENSION_SCRIPT
127+
retry 5 run_sql -f $POST_UPGRADE_EXTENSION_SCRIPT
126128
fi
127129

128130
echo "Removing SUPERUSER grant from postgres"
129-
run_sql -c "ALTER USER postgres WITH NOSUPERUSER;"
131+
retry 5 run_sql -c "ALTER USER postgres WITH NOSUPERUSER;"
130132

131133
echo "Resetting postgres database connection limit"
132-
run_sql -c "ALTER DATABASE postgres CONNECTION LIMIT -1;"
134+
retry 5 run_sql -c "ALTER DATABASE postgres CONNECTION LIMIT -1;"
133135

134136
if [ -z "$IS_CI" ] && [ -z "$IS_LOCAL_UPGRADE" ]; then
135137
echo "Unmounting data disk from ${MOUNT_POINT}"
136-
umount $MOUNT_POINT
138+
retry 3 umount $MOUNT_POINT
137139
fi
138140
echo "$UPGRADE_STATUS" > /tmp/pg-upgrade-status
139141

@@ -209,7 +211,7 @@ function patch_wrappers {
209211
WRAPPERS_LIB_PATH_DIR=$(dirname "$WRAPPERS_LIB_PATH")
210212
if [ "$WRAPPERS_LIB_PATH" != "$WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}" ]; then
211213
echo "Copying $WRAPPERS_LIB_PATH to $WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}"
212-
cp "$WRAPPERS_LIB_PATH" "$WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}"
214+
cp "$WRAPPERS_LIB_PATH" "$WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}" || true
213215
fi
214216
fi
215217
done
@@ -223,7 +225,7 @@ function patch_wrappers {
223225
LIB_FILE_NAME=$(basename "$OLD_WRAPPER_LIB_PATH")
224226
if [ "$WRAPPERS_LIB_PATH" != "$PGLIBNEW/${LIB_FILE_NAME}" ]; then
225227
echo "Copying $WRAPPERS_LIB_PATH to $PGLIBNEW/${LIB_FILE_NAME}"
226-
cp "$WRAPPERS_LIB_PATH" "$PGLIBNEW/${LIB_FILE_NAME}"
228+
cp "$WRAPPERS_LIB_PATH" "$PGLIBNEW/${LIB_FILE_NAME}" || true
227229
fi
228230
fi
229231
fi

0 commit comments

Comments
 (0)