Re: pgsql: Track last_inactive_time in pg_replication_slots.

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, shveta malik <shveta.malik@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Amit Kapila <akapila@postgresql.org>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-03-26T07:39:52Z
Lists: pgsql-hackers
On 2024-Mar-26, Amit Kapila wrote:

> We have a consensus on inactive_since, so I'll make that change.

Sounds reasonable.  So this is a timestamptz if the slot is inactive,
NULL if active, right?  What value is it going to have for sync slots?

> I would also like to solicit your opinion on the other slot-level
> parameter we are planning to introduce.  This new slot-level parameter
> will be named as inactive_timeout.

Maybe inactivity_timeout?

> This will indicate that once the slot is inactive for the
> inactive_timeout period, we will invalidate the slot. We are also
> discussing to have this parameter (inactive_timeout) as GUC [1]. We
> can have this new parameter both at the slot level and as well as a
> GUC, or just one of those.

replication_slot_inactivity_timeout?

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
Tom: There seems to be something broken here.
Teodor: I'm in sackcloth and ashes...  Fixed.
                               http://postgr.es/m/482D1632.8010507@sigaev.ru



Commits

  1. Allow synced slots to have their inactive_since.

  2. Change last_inactive_time to inactive_since in pg_replication_slots.

  3. Track last_inactive_time in pg_replication_slots.

  4. Remove vacuum_defer_cleanup_age