pgsql: Fix the handling of two GUCs during upgrade.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix the handling of two GUCs during upgrade.
Date: 2025-07-11 05:32:53
Message-ID: E1ua6NR-005huq-2i@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix the handling of two GUCs during upgrade.

Previously, the check_hook functions for max_slot_wal_keep_size and
idle_replication_slot_timeout would incorrectly raise an ERROR for values
set in postgresql.conf during upgrade, even though those values were not
actively used in the upgrade process.

To prevent logical slot invalidation during upgrade, we used to set
special values for these GUCs. Now, instead of relying on those values, we
directly prevent WAL removal and logical slot invalidation caused by
max_slot_wal_keep_size and idle_replication_slot_timeout.

Note: PostgreSQL 17 does not include the idle_replication_slot_timeout
GUC, so related changes were not backported.

BUG #18979
Reported-by: jorsol <jorsol(at)gmail(dot)com>
Author: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Reviewed by: vignesh C <vignesh21(at)gmail(dot)com>
Reviewed by: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Backpatch-through: 17, where it was introduced
Discussion: https://postgr.es/m/219561.1751826409@sss.pgh.pa.us
Discussion: https://postgr.es/m/18979-a1b7fdbb7cd181c6@postgresql.org

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/24f6c1bd41d0631a04cc956cc8cafa0b117ab625

Modified Files
--------------
src/backend/access/transam/xlog.c | 33 ++++++++-------------------------
src/backend/replication/slot.c | 12 ++++--------
src/backend/utils/misc/guc_tables.c | 2 +-
src/bin/pg_upgrade/server.c | 11 -----------
src/include/utils/guc_hooks.h | 2 --
5 files changed, 13 insertions(+), 47 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-07-11 16:49:26 pgsql: Force LC_NUMERIC to C while running TAP tests.
Previous Message Tatsuo Ishii 2025-07-11 01:45:31 pgsql: Doc: fix outdated protocol version.