Re: Fix race between copying and dropping a replication slot

From: Zhijie Hou <houzhijie22(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix race between copying and dropping a replication slot
Date: 2026-12-02 03:08:49
Message-ID: ca5d24d4-aa74-41f7-820f-05dd280d9c96@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Dec 2, 2026 at 10:20 AM Zhijie Hou wrote:
>
> On Wed, Dec 2, 2026 at 04:00 AM Masahiko Sawada wrote:
> > On Tue, Dec 1, 2026 at 4:47 AM Zhijie Hou <houzhijie22(at)gmail(dot)com> wrote:
> > >
> > >
> > > Thanks for the comments! Both comments have been addressed in v2 patch.
> >
> > Thank you for updating the patch! The patch looks good to me. Could
> > you prepare the patch for back branches? The new isolation test uses
> > the injection point 'replication-slot-create-begin', which exists
> > only in v19 and later. For v17 and v18, I think we can have the same
> > test
> > if we add the injection point there too. What do you think?
>
> Yes, I agree. Added in the V3.

One thing I forgot to mention is that adding the injection point test to
PG17 and PG18 also requires setting wal_level = logical for the
injection_points isolation test suite. If that seems undesirable on back
branches, we can skip adding the isolation test there, as in the
attached PG17-PG18 patch. The other patches can be found [1]

[1]
https://www.postgresql.org/message-id/7ebfebcc-ff16-461b-8282-3bdb00d1dfe9%40gmail.com

--
Best Regards,
Zhijie Hou

Attachment Content-Type Size
v3_2-0001-Fix-race-between-copying-and-dropping-a-replicati-PG17-PG18.patch text/plain 6.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Hayato Kuroda (Fujitsu) 2026-12-02 03:06:52 RE: [PATCH] Reuse slot helpers in pg_get_replication_slots and slot copy