Re: Fix race in ReplicationSlotRelease for ephemeral slots

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix race in ReplicationSlotRelease for ephemeral slots
Date: 2026-05-29 13:31:31
Message-ID: CAHGQGwEkkYchHB=EaArhRh25y5exhFxKxV7ZeVyG-uxUair=kw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 29, 2026 at 5:09 PM Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> > I am attaching a patch that avoids touching slot shared-memory state after
> > dropping an ephemeral slot. Keep the post-release shared-memory updates only for
> > non-ephemeral slots, where the slot remains valid after release.
>
> Thanks for the patch! It looks good to me.
> Barring any objections, I will commit it.

Since this fix should be backpatched to all supported branches,
I prepared patches for them. Attached.

Regards,

--
Fujii Masao

Attachment Content-Type Size
pg18-v1-0001-Fix-race-in-ReplicationSlotRelease-for-ephemeral-.txt text/plain 3.8 KB
pg14-pg16-v1-0001-Fix-race-in-ReplicationSlotRelease-for-ephemeral-.txt text/plain 3.2 KB
pg17-v1-0001-Fix-race-in-ReplicationSlotRelease-for-ephemeral-.txt text/plain 3.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-05-29 13:31:39 Re: injection_points: Switch wait/wakeup to use atomics rather than latches
Previous Message Heikki Linnakangas 2026-05-29 13:29:46 Re: some utf8 breaking substring(txt,1,3) but not substring(txt from '^.{4}')