File tree 3 files changed +20
-3
lines changed
files/admin_api_scripts/pg_upgrade_scripts
3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,18 @@ function cleanup {
22
22
23
23
ship_logs " $LOG_FILE " || true
24
24
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
+
25
37
exit " $EXIT_CODE "
26
38
}
27
39
Original file line number Diff line number Diff line change @@ -397,6 +397,11 @@ function initiate_upgrade {
397
397
chown -R postgres:postgres " $MOUNT_POINT /"
398
398
rm -rf " ${PGDATANEW:? } /"
399
399
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
+
400
405
if [ " $IS_NIX_UPGRADE " = " true" ]; then
401
406
if [[ " $PGVERSION " =~ ^17.* || " $PGVERSION " == " 17-orioledb" ]]; then
402
407
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:
9
9
10
10
# Full version strings for each major version
11
11
postgres_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 "
15
15
16
16
# Non Postgres Extensions
17
17
pgbouncer_release : " 1.19.0"
You can’t perform that action at this time.
0 commit comments