File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed
files/admin_api_scripts/pg_upgrade_scripts Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,18 @@ function cleanup {
2222
2323 ship_logs " $LOG_FILE " || true
2424
25+ # Restore max_slot_wal_keep_size to 4096 only if both versions were PostgreSQL 17+
26+ if [[ (" $OLD_PGVERSION " =~ ^17.* || " $OLD_PGVERSION " == " 17-orioledb" ) && (" $PGVERSION " =~ ^17.* || " $PGVERSION " == " 17-orioledb" ) ]]; then
27+ sed -i ' s/max_slot_wal_keep_size = -1/max_slot_wal_keep_size = 4096/' /etc/postgresql/postgresql.conf
28+ fi
29+
30+ # Restart postgres to apply any configuration changes
31+ if [ -z " $IS_CI " ]; then
32+ systemctl restart postgresql
33+ else
34+ CI_start_postgres
35+ fi
36+
2537 exit " $EXIT_CODE "
2638}
2739
Original file line number Diff line number Diff line change @@ -397,6 +397,11 @@ function initiate_upgrade {
397397 chown -R postgres:postgres " $MOUNT_POINT /"
398398 rm -rf " ${PGDATANEW:? } /"
399399
400+ # Change max_slot_wal_keep_size to -1 for upgrade only if both versions are PostgreSQL 17+
401+ if [[ (" $OLD_PGVERSION " =~ ^17.* || " $OLD_PGVERSION " == " 17-orioledb" ) && (" $PGVERSION " =~ ^17.* || " $PGVERSION " == " 17-orioledb" ) ]]; then
402+ sed -i ' s/max_slot_wal_keep_size = [0-9]*/max_slot_wal_keep_size = -1/' /etc/postgresql/postgresql.conf
403+ fi
404+
400405 if [ " $IS_NIX_UPGRADE " = " true" ]; then
401406 if [[ " $PGVERSION " =~ ^17.* || " $PGVERSION " == " 17-orioledb" ]]; then
402407 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -c " . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $PGBINNEW /initdb --encoding=$SERVER_ENCODING --locale-provider=icu --icu-locale=en_US.UTF-8 -L $PGSHARENEW -D $PGDATANEW / --username=supabase_admin" -s " $SHELL " postgres
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ postgres_major:
99
1010# Full version strings for each major version
1111postgres_release :
12- postgresorioledb-17 : " 17.0.1.078-orioledb-upgrade-3 "
13- postgres17 : " 17.4.1.028-upgrade-3 "
14- postgres15 : " 15.8.1.085-upgrade-3 "
12+ postgresorioledb-17 : " 17.0.1.078-orioledb-upgrade-4 "
13+ postgres17 : " 17.4.1.028-upgrade-4 "
14+ postgres15 : " 15.8.1.085-upgrade-4 "
1515
1616# Non Postgres Extensions
1717pgbouncer_release : " 1.19.0"
You can’t perform that action at this time.
0 commit comments