pgsql: Change unit of idle_replication_slot_timeout to seconds.

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Change unit of idle_replication_slot_timeout to seconds.
Date: 2025-07-10 23:43:49
Message-ID: E1ua0vd-005fCs-27@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Change unit of idle_replication_slot_timeout to seconds.

Previously, the idle_replication_slot_timeout parameter used minutes
as its unit, based on the assumption that values would typically exceed
one minute in production environments. However, this caused unexpected
behavior: specifying a value below 30 seconds would round down to 0,
effectively disabling the timeout. This could be surprising to users.

To allow finer-grained control and avoid such confusion, this commit changes
the unit of idle_replication_slot_timeout to seconds. Larger values can
still be specified easily using standard time suffixes, for example,
'24h' for 24 hours.

Back-patch to v18 where idle_replication_slot_timeout was added.

Reported-by: Gunnar Morling <gunnar(dot)morling(at)googlemail(dot)com>
Author: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Reviewed-by: David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Reviewed-by: Hayato Kuroda <kuroda(dot)hayato(at)fujitsu(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/CADGJaX_0+FTguWpNSpgVWYQP_7MhoO0D8=cp4XozSQgaZ40Odw@mail.gmail.com
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/05dedf43d380edc98546c381e76a9d907fd19bed

Modified Files
--------------
doc/src/sgml/config.sgml | 2 +-
src/backend/replication/slot.c | 21 +++++++++------------
src/backend/utils/misc/guc_tables.c | 6 +++---
src/backend/utils/misc/postgresql.conf.sample | 2 +-
src/include/replication/slot.h | 2 +-
5 files changed, 15 insertions(+), 18 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2025-07-10 23:44:03 pgsql: Change unit of idle_replication_slot_timeout to seconds.
Previous Message Daniel Gustafsson 2025-07-10 21:39:03 pgsql: Fix sslkeylogfile error handling logging