postgresql/src
Amit Kapila a11f330b55 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.

The 'last_inactive_time' will be useful on production servers to debug and
analyze inactive replication slots. It will also help to know the lifetime
of a replication slot - one can know how long a streaming standby, logical
subscriber, or replication slot consumer is down.

The 'last_inactive_time' will also be useful to implement inactive
timeout-based replication slot invalidation in a future commit.

Author: Bharath Rupireddy
Reviewed-by: Bertrand Drouvot, Amit Kapila, Shveta Malik
Discussion: https://www.postgresql.org/message-id/CALj2ACW4aUe-_uFQOjdWCEN-xXoLGhmvRFnL8SNw_TZ5nJe+aw@mail.gmail.com
2024-03-25 16:34:33 +05:30
..
backend Track last_inactive_time in pg_replication_slots. 2024-03-25 16:34:33 +05:30
bin reindexdb: Fix warning about uninitialized indices_tables_cell 2024-03-25 11:40:25 +02:00
common Fix convert_case(), introduced in 5c40364dd6. 2024-03-24 16:28:34 -07:00
fe_utils Allow dbname to be written as part of connstring via pg_basebackup's -R option. 2024-03-21 10:50:33 +05:30
include Track last_inactive_time in pg_replication_slots. 2024-03-25 16:34:33 +05:30
interfaces Explicitly require password for SCRAM exchange 2024-03-21 14:45:54 +01:00
makefiles Remove AIX support 2024-02-28 15:17:23 +04:00
pl Activate perlcritic InputOutput::RequireCheckedSyscalls and fix resulting warnings 2024-03-19 07:09:31 +01:00
port Inline pg_popcount{32,64} into pg_popcount(). 2024-03-19 14:46:16 -05:00
template Remove AIX support 2024-02-28 15:17:23 +04:00
test Track last_inactive_time in pg_replication_slots. 2024-03-25 16:34:33 +05:30
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools ci: freebsd repartition script didn't copy .git directory 2024-03-24 08:41:14 +01:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Remove make function vpathsearch 2024-01-29 07:24:59 +01:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00