Function to get invalidation cause of a replication slot. - Mailing list pgsql-hackers

From shveta malik
Subject Function to get invalidation cause of a replication slot.
Date
Msg-id CAJpy0uBpr0ym12+0mXpjcRFA6N=anX+Yk9aGU4EJhHNu=fWykQ@mail.gmail.com
Whole thread Raw
Responses Re: Function to get invalidation cause of a replication slot.
List pgsql-hackers
Hello hackers,

Attached is a patch which attempts to implement a new system function
pg_get_slot_invalidation_cause('slot_name')  to get invalidation cause
of a replication slot.

Currently, users do not have a way to know the invalidation cause. One
can only find out if the slot is invalidated or not by querying the
'conflicting' field of pg_replication_slots. This new function
provides a way to query invalidation cause as well.

One of the use case scenarios for this function is another ongoing
thread "Synchronizing slots from primary to standby" at [1].  This
function is needed there to replicate invalidation-cause of a logical
replication slot from the primary server to the hot standby. But this
is an independent requirement in itself and thus makes sense to have
it implemented separately.

Please review and provide your feedback.

[1]: https://www.postgresql.org/message-id/514f6f2f-6833-4539-39f1-96cd1e011f23%40enterprisedb.com

thanks
Shveta

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Synchronizing slots from primary to standby
Next
From: Peter Smith
Date:
Subject: Re: Synchronizing slots from primary to standby