Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wT0Ju-000FhR-21 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2026 16:44:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wT0Jt-003ac5-0O for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2026 16:44:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wT0Js-003abx-1w for pgsql-hackers@lists.postgresql.org; Fri, 29 May 2026 16:44:25 +0000 Received: from mail-vk1-xa2c.google.com ([2607:f8b0:4864:20::a2c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wT0Jq-000000009EZ-2BCa for pgsql-hackers@lists.postgresql.org; Fri, 29 May 2026 16:44:24 +0000 Received: by mail-vk1-xa2c.google.com with SMTP id 71dfb90a1353d-57611a6a69eso4344644e0c.3 for ; Fri, 29 May 2026 09:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780073062; cv=none; d=google.com; s=arc-20240605; b=C1QNfUyVP9NYXY4ex2kYPI+tHMlrxiks0/+8zoPjZ/rz80JlLJIVpWX0tE0YzexMbe zPEPW7uVTeE7Gny3/HqqWlSYJNhFaIL3ZBD9hSYkkN33u42Jli+N08+4Uxlaf+cAfdsb 8+69NQGgkJkGUhFuZnAXRFuTJ75s6usCiUh0lY1hQ1iDekugbp6KzCBaxCegHiCYx2za puwXWRzIddCo0hvjp6jpc0Pie5Y5HpOR5ZwdTi2y6Rr8GXYhwnJrHe1xbjBWNOKFV7p0 2Cve9VBYoaqoHEWpBO1d3JweebBmD1vPhxSRwg6idKT7CF1cWzQZEO+X6qO8oc3as3JF aE6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=8CKqg67VbLWQ+PucpdchU7u0CaDZnQ3tnPMbcf/RNXc=; fh=Ti5UUWWnIawXjRDrxK96yl2MCM81GcRJ2EeXAktfwrY=; b=lAMyTf2oro2a1tYh0KmJVl5AyyRjKSS+Mp9jSkLXFtSM4xvEhK0K35jls/3M2uMGM2 7x1iXvxBDYnAWiHwuueQHqIowBxFQsSf8fApVncW8oB9049NZMCAsZo/0bOQiv9Dk0+3 AELKVV66uyTIFRMV+a3EDX4EmcmLkscHEP/Y31vI+WQadzM9ENZPawb7yCAjNWVKkBJR oM/v48/Rkj8u+XHTT5d7C0jlR5OF3hcxxNAK0+v7WZm/1oM48njBV3BJl3t71axA1eBz Z/xy8VPOpZjTx82QsThQHmD4EIiuXOmDInxMp9G2dpgHNshrcY3aLeTr28Y0hx0fGI0h w1Vw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780073062; x=1780677862; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8CKqg67VbLWQ+PucpdchU7u0CaDZnQ3tnPMbcf/RNXc=; b=WNsr3ULH0RqQm9+KyEoYNTynfFGKRHbIAGRMxysGyenpVtqywybE9hoKL8XN5me2dg GHlSlTUEBFwsTgB977k6AtMcSGraTDabx2vexRtwmU8AhzGqWZLgm0QP1oxIfaR405HM 4s8Jt8GecdNTFTeaSH3xSQ6Sau6ZlZiQ7JfUALUmYIeMghKq0ehqUIwhJXujzXp6d6B5 S125XWQ2pmTUsGB3uUv5+HNXbbP6vmAiH/Oke3YWnggVuAdSog6bUkiXAXzACfNNWX/K F8D7ARhBbGvh33ovi0ys/+pKLa4Vv1vSNTQp5d9GUUFnUzhVJ3i56GunkyvONPvM3Ed0 g4Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780073062; x=1780677862; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8CKqg67VbLWQ+PucpdchU7u0CaDZnQ3tnPMbcf/RNXc=; b=JbkuMOHDrQX+ETxgl3JW0S5ZAIPgGJFH5EQ3WIA/aushBCaXoBCFc8KbfHBgUi7sZS ZWMxoFBmJAw0T1vE2RQQia0KAQ6IZCdgOMiv4//fjyKE0nLuwZhzS1WiS7Gkq1gzJOap S7QjjXQP9bKZwxEOsjEIJPe4+YPgTP9vd5nec3ks0QVgK9z1QNTDjo9tJ4XH3NDvPPPx iIG6siUw0stvt9WhtQf4cRZDwJ01ClubeZP5S7aYRMMDpEcBnh/giSJxM3l41/ZU6mZm lDOlz6xbxo9RtIthzCtW+XH2KfsWTZvzuVtf6esGfgdS2MO20t1ByN2EZlK1N8PZdnug hbAw== X-Gm-Message-State: AOJu0YwanM8/BcaeDnwdAxMRk1zV16cCdYFCStYlcoL5ViZv5acOr9rI OGsT10UX5w95rdJsp31lFiI0OUwuyZl+GHsX3NwI7WKUy0k5iGS5I6deDUklMJj4N8bdncfBOaK gNMITF0OXyQHuYN4Ob1MMdK7JQwSCUYc= X-Gm-Gg: Acq92OEKavbSfwIbZlS0NEDSzZjvCxeJzboHJD76O5+eODtRhnXsCBL+pfTVeR7KMnW kLxjfE/bQJyZgX9LwzLj4jKLS3oAc7Gg09N5j9KcieFFFuTbDjHUMPEiiY/Rxl3IJqviRb/YjpM kW0umb2fjlOEim+2Sgt82aV2Whg+lQJuRo0jZr5mTjVU7+sj9axCIZkEcMS2r/3UwAtm7UXjxH1 v35jYwU4IFIvZkPSAxbCNuFp61qe6MY194qucwFs9PsEgtvf4g/dMelsM/Upmty7GBvYq3FwnGO QuvsiBkLroLRPEA/ZjJAhhHcb5Wu64Rc1oCVQd5n0V/O2hQI5sZhnwscKJqUSmgjnvHVYfZpHTn SaMNG2XHFplBIrJodM1EYp0GqFrp0csaYiPPW5w== X-Received: by 2002:a05:6122:1e09:b0:575:24a9:78da with SMTP id 71dfb90a1353d-59bf52e4d01mr30081e0c.11.1780073061870; Fri, 29 May 2026 09:44:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Srinath Reddy Sadipiralla Date: Fri, 29 May 2026 22:14:10 +0530 X-Gm-Features: AVHnY4IsEn87McTLuOKFmaRZRpvWq_khODpj7IBeVr2khfUH1qMdjmafIv5WnVc Message-ID: Subject: Re: Fix race in ReplicationSlotRelease for ephemeral slots To: "Zhijie Hou (Fujitsu)" Cc: PostgreSQL Hackers Content-Type: multipart/mixed; boundary="0000000000008797e70652f78ebb" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008797e70652f78ebb Content-Type: multipart/alternative; boundary="0000000000008797e60652f78eb9" --0000000000008797e60652f78eb9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Wed, May 27, 2026 at 5:20=E2=80=AFPM Zhijie Hou (Fujitsu) wrote: > Hi, > > While testing the slot release logic, I noticed a bug in > ReplicationSlotRelease() where it may access a replication slot array > entry that > has already been released by itself. > > The detail is: When releasing an ephemeral replication slot, > ReplicationSlotRelease() first drops the slot via > ReplicationSlotDropAcquired(). > After this point, the slot's shared memory slot array entry can be > immediately > reused by another backend creating a new slot. > > However, ReplicationSlotRelease() continued executing common cleanup code > that > still dereferenced the old slot pointer and updated shared memory fields > such as > effective_xmin. If the slot array entry had already been reallocated, the= se > writes could inadvertently affect a different, unrelated slot. > > I am attaching a patch that avoids touching slot shared-memory state afte= r > dropping an ephemeral slot. Keep the post-release shared-memory updates > only for > non-ephemeral slots, where the slot remains valid after release. > > To reproduce, we can use the following steps: > > 1. Attach gdb to the backend and set a breakpoint in > ReplicationSlotRelease() > right after ReplicationSlotDropAcquired() is called. > 2. Create an ephemeral slot in the above backend with an invalid output > plugin: > SELECT pg_create_logical_replication_slot('test_slot_dropped', > 'pgoutput2', false, false, true); > 3. Once the breakpoint is hit, start another backend and create a new slo= t > named 'test_slot_created'. > 4. Release the breakpoint and allow the first backend to continue. At thi= s > point, you will see it updating the new slot 'test_slot_created' -> > active_proc > (and effective_xmin, if a snapshot is being exported) to invalid value= s. > 5. Start a third backend and attempt to acquire the same slot > 'test_slot_created' ? this should not be possible under normal > circumstances, > but the bug allows it. > patch LGTM. > > I haven't attached a test for this fix, as the change is straightforward > and the > likelihood of encountering this bug is low, so it may not be worth adding > test > cycles for it. However, if others feel differently, I'm OK to add one. > +1 for a test. The fix is just an else, so a future refactor could change it and silently reintroduce the corruption, since it scribbles on an unrelated reused slot, nothing would catch it. Injection points make it deterministic; I've attached a diff patch that adds a test that fails without the fix and passes with it. --=20 Thanks, Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/ --0000000000008797e60652f78eb9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Wed, May 27, = 2026 at 5:20=E2=80=AFPM Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com> wrote:
Hi,

While testing the slot release logic, I noticed a bug in
ReplicationSlotRelease() where it may access a replication slot array entry= that
has already been released by itself.

The detail is: When releasing an ephemeral replication slot,
ReplicationSlotRelease() first drops the slot via ReplicationSlotDropAcquir= ed().
After this point, the slot's shared memory slot array entry can be imme= diately
reused by another backend creating a new slot.

However, ReplicationSlotRelease() continued executing common cleanup code t= hat
still dereferenced the old slot pointer and updated shared memory fields su= ch as
effective_xmin. If the slot array entry had already been reallocated, these=
writes could inadvertently affect a different, unrelated slot.

I am attaching a patch that avoids touching slot shared-memory state after<= br> dropping an ephemeral slot. Keep the post-release shared-memory updates onl= y for
non-ephemeral slots, where the slot remains valid after release.

To reproduce, we can use the following steps:

1. Attach gdb to the backend and set a breakpoint in ReplicationSlotRelease= ()
=C2=A0 =C2=A0right after ReplicationSlotDropAcquired() is called.
2. Create an ephemeral slot in the above backend with an invalid output plu= gin:
=C2=A0 =C2=A0SELECT pg_create_logical_replication_slot('test_slot_dropp= ed', 'pgoutput2', false, false, true);
3. Once the breakpoint is hit, start another backend and create a new slot<= br> =C2=A0 =C2=A0named 'test_slot_created'.
4. Release the breakpoint and allow the first backend to continue. At this<= br> =C2=A0 =C2=A0point, you will see it updating the new slot 'test_slot_cr= eated' -> active_proc
=C2=A0 =C2=A0(and effective_xmin, if a snapshot is being exported) to inval= id values.
5. Start a third backend and attempt to acquire the same slot
=C2=A0 =C2=A0'test_slot_created' ? this should not be possible unde= r normal circumstances,
=C2=A0 =C2=A0but the bug allows it.

patch LGTM.=C2=A0

I haven't attached a test for this fix, as the change is straightforwar= d and the
likelihood of encountering this bug is low, so it may not be worth adding t= est
cycles for it. However, if others feel differently, I'm OK to add one.<= br>
=C2=A0
+1 for a test. The fix is just an els= e, so a future refactor could change it and silently
reintroduce the cor= ruption, since it scribbles on an unrelated reused slot, nothing
would c= atch it. Injection points make it deterministic; I've attached a diff p= atch that adds
a test that fails without the fix and passes with it.
=

--
Thanks,
Srinath Reddy Sadipiralla
EDB:=C2= =A0https://www.enterprisedb.com/
--0000000000008797e60652f78eb9-- --0000000000008797e70652f78ebb Content-Type: application/octet-stream; name="nocfbot-test.patch" Content-Disposition: attachment; filename="nocfbot-test.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_mpr5i3a60 ZGlmZiAtLWdpdCBhL3NyYy9iYWNrZW5kL3JlcGxpY2F0aW9uL3Nsb3QuYyBiL3NyYy9iYWNrZW5k L3JlcGxpY2F0aW9uL3Nsb3QuYwppbmRleCBmMDEyZTk5YzlkNy4uYTkxMDgyZWZiOWMgMTAwNjQ0 Ci0tLSBhL3NyYy9iYWNrZW5kL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