Re: [PATCH] Release replication slot on error in SQL-callable slot functions

From: kedar anavardekar <kedar(dot)anavardekar(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Release replication slot on error in SQL-callable slot functions
Date: 2026-09-18 08:30:49
Message-ID: CAJZSXGq07wxOz9qEE-qOUkTs2NAQi9Ys84F2UdXw-H7nRUFH6Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Bharath,

Two minor naming suggestions: (please take the suggestions if you
think the points are valid)
1. Could MyReplicationSlotSubId be renamed to
MyReplicationSlotSubXactId (or MyReplicationSlotSubTransactionId)

SubId may be read as a subscription ID, whereas this variable stores
the SubTransactionId of the subtransaction that acquired
MyReplicationSlot. The more explicit name would make its purpose
clearer and avoid confusion with logical replication subscriptions.

2., could the comment above AtEOSubXact_ReplicationSlot() be revised from:
/*
* At subxact end, release the replication slot if the subtransaction
* where the slot was acquired is aborted.
*/
to:
/*
* At subxact end, release the replication slot if the subtransaction
* in which the slot was acquired is aborted.
*/
“In which” is more precise here because the slot is acquired during
that subtransaction.

--
Thanks & Regards,
Kedar

On Fri, Sep 18, 2026 at 1:43 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> Hi,
>
> On Wed, Sep 16, 2026 at 6:37 PM Bharath Rupireddy
> <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> >
> > Please find the attached patch for HEAD. I dropped the two unnecessary
> > header file inclusions added in the diff but otherwise took it as-is.
> > If it looks good, I can prepare the patches for all supported
> > branches.
>
> Please find the attached patches for HEAD and all supported branches.
> Thanks to all for reviewing and sharing thoughts.
>
> --
> Bharath Rupireddy
> Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2026-09-18 08:48:19 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Chao Li 2026-09-18 08:27:50 Re: COMMENT/SEC LABEL tab complete support suggests wrong SQL.