Track in pg_replication_slots the reason why slots conflict? - Mailing list pgsql-hackers

From Michael Paquier
Subject Track in pg_replication_slots the reason why slots conflict?
Date
Msg-id ZYOE8IguqTbp-seF@paquier.xyz
Whole thread Raw
Responses Re: Track in pg_replication_slots the reason why slots conflict?
Re: Track in pg_replication_slots the reason why slots conflict?
List pgsql-hackers
Hi all,
(Bertrand and Andres in CC.)

While listening at Bertrand's talk about logical decoding on standbys
last week at Prague, I got surprised by the fact that we do not
reflect in the catalogs the reason why a conflict happened for a slot.
There are three of them depending on ReplicationSlotInvalidationCause:
- WAL removed.
- Invalid horizon.
- Insufficient WAL level.

This idea has been hinted around here on the original thread that led
to be87200efd93:
https://www.postgresql.org/message-id/d7547f2c-a0c3-6aad-b631-b7ed5efaf298@gmail.com
However v44 has picked up the idea of a boolean:
https://www.postgresql.org/message-id/bdc49e0b-cd39-bcd3-e391-b0ad6e48b5cf@gmail.com

ReplicationSlotCtl holds this information, so couldn't it be useful
for monitoring purposes to know why a slot got invalidated and add a
column to pg_get_replication_slots()?  This could just be an extra
text conflicting_reason, defaulting to NULL when there's nothing to
see.

Thoughts?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Jeremy Schneider
Date:
Subject: Re: Built-in CTYPE provider
Next
From: Jeremy Schneider
Date:
Subject: Re: Built-in CTYPE provider