Re: Unexpected behavior when setting "idle_replication_slot_timeout" - Mailing list pgsql-bugs

From Laurenz Albe
Subject Re: Unexpected behavior when setting "idle_replication_slot_timeout"
Date
Msg-id 686577f2379e4b978803e72746dcf0dd7baf3937.camel@cybertec.at
Whole thread Raw
In response to Unexpected behavior when setting "idle_replication_slot_timeout"  (Gunnar Morling <gunnar.morling@googlemail.com>)
Responses Re: Unexpected behavior when setting "idle_replication_slot_timeout"
Re: Unexpected behavior when setting "idle_replication_slot_timeout"
List pgsql-bugs
On Sat, 2025-07-05 at 00:22 +0900, Fujii Masao wrote:
> On 2025/07/04 23:12, Fujii Masao wrote:
> > But I wonder why the current unit of this GUC is minutes (GUC_UNIT_MIN).
> > Since at least two users (including myself) tried to set it to a value
> > less than 1 minute, it might worth considering changing the unit to seconds
> > (GUC_UNIT_S). Also which would reduces the chance of the reported trouble.
>
> Attached patch changes unit of idle_replication_slot_timeout to seconds.

-1

I think that the reason that several users tried to set it it less than a minute
is that they were trying to test the feature and didn't want to wait long.
I cannot imagine that anybody will want to abandon a standby server just
because it is idle for more than 30 seconds.

For me, there would be two appealing alternatives:

1. Always round up to the next minute.

2. Use the value -1 to deactivate the feature.
   Optionally, we could forbid the value 0 in this case.

Stepping back a bit, I am not happy with the documentation.  I looked at it,
trying to figure out what the parameter does, and I am none the wiser.
What exactly does it mean for a replication slot to idle?

- Does it mean that the standby is not connected?
- Does it mean that the standby is connected, but gives no feedback?
  Probably not, but I only guess that because I know that there is a different
  parameter for that.
- Does it mean that the standby is giving feedback, but that feedback doesn't
  indicate progress?

I think we could do better here.

Yours,
Laurenz Albe



pgsql-bugs by date:

Previous
From: Gunnar Morling
Date:
Subject: Unexpected behavior when setting "idle_replication_slot_timeout"
Next
From: Fujii Masao
Date:
Subject: Re: Unexpected behavior when setting "idle_replication_slot_timeout"