Re: pgsql: Track last_inactive_time in pg_replication_slots.
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Amit Kapila <akapila@postgresql.org>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-03-25T13:26:57Z
Lists: pgsql-hackers
On Mon, Mar 25, 2024 at 7:11 AM Amit Kapila <akapila@postgresql.org> wrote: > Track last_inactive_time in pg_replication_slots. > > This commit adds a new property called last_inactive_time for slots. It is > set to 0 whenever a slot is made active/acquired and set to the current > timestamp whenever the slot is inactive/released or restored from the disk. > Note that we don't set the last_inactive_time for the slots currently being > synced from the primary to the standby because such slots are typically > inactive as decoding is not allowed on those. So the field name is last_inactive_time, but if I'm reading this description right, it's actually the last time the slot was active, except for the weird exception for slots being synced. I'm wondering if this field needs to be renamed. And I'm suspicious that having an exception for slots being synced is a bad idea. That makes too much of a judgement about how the user will use this field. It's usually better to just expose the data, and if the user needs helps to make sense of that data, then give them that help separately. In this case, that would mean removing the exception, but making it easy to tell the difference between slots are inactive because they're being synced and slots that are inactive for some other reason. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Allow synced slots to have their inactive_since.
- 6f132ed693b6 17.0 landed
-
Change last_inactive_time to inactive_since in pg_replication_slots.
- 6d49c8d4b4f4 17.0 landed
-
Track last_inactive_time in pg_replication_slots.
- a11f330b5584 17.0 cited
-
Remove vacuum_defer_cleanup_age
- 1118cd37eb61 16.0 cited