RE: [PATCH] Release replication slot on error in SQL-callable slot functions - Mailing list pgsql-hackers

From Zhijie Hou (Fujitsu)
Subject RE: [PATCH] Release replication slot on error in SQL-callable slot functions
Date
Msg-id TY4PR01MB17718C386870F9DAD4B0BF9BC94162@TY4PR01MB17718.jpnprd01.prod.outlook.com
Whole thread
In response to Re: [PATCH] Release replication slot on error in SQL-callable slot functions  (SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>)
List pgsql-hackers
On Friday, May 29, 2026 1:11 PM SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>  wrote:
> Thanks for the patches, I combined these changes in my latest patch. Please find the v5.

Thanks for updating the patch.

Few comments:

1.

The patch places PG_CATCH() inside create_logical_replication_slot(), but the
caller may still error out before releasing the slot. It would be better to
catch the error at the caller level instead. The same problem exists in
copy_replication_slot(), which does not include the slot persistence logic
within its CATCH block.

2.

I have a concern about the LWLock handling added within the PG_CATCH block, see [1].

[1]
https://www.postgresql.org/message-id/TY4PR01MB17718F04D32E0073F0BC7EC0294082%40TY4PR01MB17718.jpnprd01.prod.outlook.com

Best Regards,
Hou zj

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications
Next
From: shveta malik
Date:
Subject: Re: [PATCH] Release replication slot on error in SQL-callable slot functions