From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
Cc: | "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Function to get invalidation cause of a replication slot. |
Date: | 2023-12-21 05:47:49 |
Message-ID: | ZYPRhcDANNohpo9P@paquier.xyz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Dec 21, 2023 at 09:37:39AM +0530, Amit Kapila wrote:
> It depends on how one uses the function. For example, if one finds
> there is a conflict via pg_get_replication_slots() and wants to check
> the reason for the same via this new function then it would give the
> correct answer.
My point is that we may not get the "correct" answer at all :/
What guarantee do you have that between the scan of
pg_get_replication_slots() to get the value of "conflicting" and the
call of pg_get_slot_invalidation_cause() the slot state will still be
the same? A lot could happen between both function calls while the
repslot LWLock is not hold.
> Now, if we think it is okay to have two columns
> 'conflicting' and 'conflict_reason/conflict_cause' to be returned by
> pg_get_replication_slots() then that should serve the purpose as well
> but one can argue that 'conflicting' is deducible from
> 'conflict_reason'.
Yeah, you could keep the reason text as NULL when there is no
conflict, replacing the boolean by the text in the function, and keep
the view definition compatible with v16 while adding an extra column.
--
Michael
From | Date | Subject | |
---|---|---|---|
Next Message | Bertrand Drouvot | 2023-12-21 05:56:12 | Re: Add isCatalogRel in rmgrdesc |
Previous Message | Michael Paquier | 2023-12-21 05:38:55 | Re: WAL Insertion Lock Improvements |