Function to get invalidation cause of a replication slot.

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
Subject: Function to get invalidation cause of a replication slot.
Date: 2023-12-20 06:01:04
Message-ID: CAJpy0uBpr0ym12+0mXpjcRFA6N=anX+Yk9aGU4EJhHNu=fWykQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
v1-0001-Function-to-get-invalidation-cause-of-a-replicati.patch application/octet-stream 4.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2023-12-20 06:31:38 Re: Synchronizing slots from primary to standby
Previous Message Amit Kapila 2023-12-20 05:52:47 Re: Synchronizing slots from primary to standby