Обсуждение: BUG #18979: pg_upgrade to PG17 fails if max_slot_wal_keep_size is not set to -1
BUG #18979: pg_upgrade to PG17 fails if max_slot_wal_keep_size is not set to -1
От
PG Bug reporting form
Дата:
The following bug has been logged on the website: Bug reference: 18979 Logged by: Jorge Solorzano Email address: jorsol@gmail.com PostgreSQL version: 17.5 Operating system: Linux Description: Steps to Reproduce: 1. On a PostgreSQL 16 cluster, set max_slot_wal_keep_size = 500 (or any non-default value). 2. Initdb a new PostgreSQL 17 cluster. 3. Copy the postgresql.conf from 16 to 17. 4. Attempt to perform a binary upgrade to PostgreSQL 17 using pg_upgrade --check. Expected Behavior: pg_upgrade should automatically override max_slot_wal_keep_size to -1 as required for upgrade mode. Actual Behavior: The upgrade fails with the following error: command: "/usr/pgsql-17/bin/pg_ctl" -w -l "/var/lib/pgsql/17/data/pg_upgrade_output.d/20250706T152559.441/log/pg_upgrade_server.log" -D "/var/lib/pgsql/17/data" -o "-p 50432 -b -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c max_slot_wal_keep_size=-1 -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/var/lib/pgsql'" start >> "/var/lib/pgsql/17/data/pg_upgrade_output.d/20250706T152559.441/log/pg_upgrade_server.log" 2>&1 waiting for server to start....2025-07-06 13:25:59.929 GMT [9439] LOG: invalid value for parameter "max_slot_wal_keep_size": 500 2025-07-06 13:25:59.929 GMT [9439] DETAIL: "max_slot_wal_keep_size" must be set to -1 during binary upgrade mode. 2025-07-06 15:25:59.930 CEST [9439] FATAL: configuration file "/var/lib/pgsql/17/data/postgresql.conf" contains errors stopped waiting pg_ctl: could not start server Additional Context: While pg_upgrade does pass other required parameters like -c max_slot_wal_keep_size=-1 on the command line when starting the new cluster in upgrade mode, the value in postgresql.conf appears to override this, leading to startup failure. It would be helpful if pg_upgrade temporarily overrides the setting correctly, regardless of the static config.