Hi, On Mon, Aug 31, 2026 at 3:06 PM Masahiko Sawada <[email protected]> wrote: > > On Sun, Aug 30, 2026 at 9:40 PM Amit Kapila <[email protected]> wrote: > > > > On Sat, Aug 29, 2026 at 4:42 AM Bharath Rupireddy > > <[email protected]> wrote: > > > > > > In the replication slot subxact callback, on the abort path, we need > > > to know whether the slot's creation failed. Ephemeral slots already > > > handle that, but only for persistent logical slots. A temporary slot > > > stays RS_TEMPORARY throughout. So there are a few ways to solve this: > > > > > > 1/ Also mark temporary slots as ephemeral initially and transition > > > them to RS_TEMPORARY once creation succeeds. A quick check shows this > > > needs changes in many places. > > > 2/ Introduce a new state to represent a temporary slot still in > > > creation (RS_TEMPORARY_EPHEMERAL or such). > > > 3/ Use a boolean in the ReplicationSlot structure > > > (is_create_in_progress or such), and in the subxact callback, when the > > > slot is temporary and is_create_in_progress is set, drop just that > > > temporary slot and leave the others alone. > > > > > > I prefer option 3, > > > > > > > I would prefer option-1 as we have a similar pre-existing behaviour. > > > > to keep it simple without adding a new state, and > > > because it is back-branch friendly. > > > > > > > BTW, I was thinking this to be improved in HEAD-only as it is a more > > impactful change. > > I was thinking the same. Even if we use option-1, an error could still > happen when saving the slot to the disk (in ReplicationSlotSave()), > leaving the slot behind while returning an error to the client. We > might want to address that point too, and it should be only for HEAD.
I will start a separate thread for this soon. Thanks. -- Bharath Rupireddy Amazon Web Services: https://aws.amazon.com
