Skip to content

Commit 11dab86

Browse files
committed
feat: binary upgrades require max_slot_wal_keep_size to be -1 during binary upgrade
1 parent cf59660 commit 11dab86

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ 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
25+
# Restore max_slot_wal_keep_size to 4096 after binary upgrade
26+
sed -i 's/max_slot_wal_keep_size = -1/max_slot_wal_keep_size = 4096/' /etc/postgresql/postgresql.conf
2927

3028
# Restart postgres to apply any configuration changes
3129
if [ -z "$IS_CI" ]; then

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,8 @@ 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
400+
# Change max_slot_wal_keep_size to -1 for binary upgrade
401+
sed -i 's/max_slot_wal_keep_size = [0-9]*/max_slot_wal_keep_size = -1/' /etc/postgresql/postgresql.conf
404402

405403
if [ "$IS_NIX_UPGRADE" = "true" ]; then
406404
if [[ "$PGVERSION" =~ ^17.* || "$PGVERSION" == "17-orioledb" ]]; then

0 commit comments

Comments
 (0)