Re: Unexpected behavior when setting "idle_replication_slot_timeout"

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: Gunnar Morling <gunnar(dot)morling(at)googlemail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Unexpected behavior when setting "idle_replication_slot_timeout"
Date: 2025-07-04 12:14:04
Message-ID: CABdArM76e8-XChodqKxEiRK3tR_Yv3cymn_AWfP4bOsLDscZAg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Jul 4, 2025 at 4:35 PM Gunnar Morling
<gunnar(dot)morling(at)googlemail(dot)com> wrote:
>
> Hi all,
>
> I am exploring the new setting "idle_replication_slot_timeout" in Postgres 18; for testing purposes, I set the value to "30s", which, unexpectedly to me, didn't cause an idle slot to be invalidated when I triggered a checkpoint after the timeout had been reached.
>
> The docs of the option state that the value is rounded up or down to the nearest full minute, so I reckon "30s" gets rounded down to 0, thus effectively disabling the feature. It might be less surprising to users if values between "1s" and "59s" get actually always rounded up to one minute? Arguably, that'd seem the more intuitive behavior to me. Alternatively, logging a warning might be considered for values between "1s" and "30s"? Curious what folks here think.
>

Thanks for bringing this up!

Yes, this is expected behavior, idle_replication_slot_timeout accepts
values in minutes, so a setting like "30s" is rounded down to 0,
effectively disabling the timeout, while values >= "31s" are rounded
up to 1.

This behavior isn’t specific to this GUC as Postgres generally rounds
values below a parameter’s minimum unit without a warning. For
example, wal_summary_keep_time and log_rotation_age behave the same
way.

--
Thanks,
Nisha

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fujii Masao 2025-07-04 14:12:40 Re: Unexpected behavior when setting "idle_replication_slot_timeout"
Previous Message Gunnar Morling 2025-07-04 09:54:15 Unexpected behavior when setting "idle_replication_slot_timeout"