RE: [PATCH] Release replication slot on error in SQL-callable slot functions
Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>
From: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
To: SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>, Fujii Masao <masao.fujii@gmail.com>
Cc: shveta malik <shveta.malik@gmail.com>, vignesh C <vignesh21@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, shveta malik <shvetamalik@gmail.com>
Date: 2026-05-29T05:36:49Z
Lists: 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