Re: BUG #18979: pg_upgrade to PG17 fails if max_slot_wal_keep_size is not set to -1

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "jorsol(at)gmail(dot)com" <jorsol(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18979: pg_upgrade to PG17 fails if max_slot_wal_keep_size is not set to -1
Date: 2025-07-06 15:11:25
Message-ID: CAKFQuwZ_fh5uJV59+AcqZ9fDzQ=604GRHXB8DUEBEM-c5A3UEA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sunday, July 6, 2025, PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference: 18979
> Logged by: Jorge Solorzano
> Email address: jorsol(at)gmail(dot)com
> PostgreSQL version: 17.5
> Operating system: Linux
> Description:
>
> 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 doesn’t override it but both the value in the conf and the one on the
startup command are evaluated and the one in the conf causes the failure
before the startup command version can restore the system to a valid
state. I.e., validation is not deferred.

It would be helpful if pg_upgrade temporarily overrides the setting
> correctly, regardless of the static config.
>
>
The existing behavior by pg_upgrade makes sense but it pointless given the
existing implementation of setting handling. It seems doable to remove the
check from the setting area and place it elsewhere.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-07-06 15:26:51 Re: BUG #18979: pg_upgrade to PG17 fails if max_slot_wal_keep_size is not set to -1
Previous Message PG Bug reporting form 2025-07-06 13:58:20 BUG #18979: pg_upgrade to PG17 fails if max_slot_wal_keep_size is not set to -1