Hi, On Thu, Nov 19, 2026 at 01:09:42PM +0530, Amit Kapila wrote: > On Thu, Nov 19, 2026 at 12:02 PM Zhijie Hou <[email protected]> wrote: > > > > > > I think that could be too late. With parallel streaming, a parallel > > > apply worker may already have executed the transaction's changes. > > > > > > IIUC, it wouldn't be too late. Even if the changes are already being > > executed, the transaction won't be prepared if we catch the mismatch in > > apply_handle_prepare (and related functions). > > > > Right, I also thought so.
I agree that the transaction itself will not be prepared and its transactional changes will be rolled back. My concern is that, with parallel streaming, subscriber nontransactional effects may already have occurred before STREAM PREPARE (for example, subscriber having a default column calling nextval()). This can also happen with other apply errors, so it is not new. However, this particular error is predictable before decoding starts, and checking there avoids entering that path unnecessarily. Maybe I'm being overly concerned about this though? > Also, I don't like adding new options for > detecting these ERROR cases, Yeah, I see the concern. The reason for passing the expected values to pgoutput is to let the publisher validate the actual slot after acquiring it and before decoding starts. > BTW, I don't know what to do for a > failover property if we go with this idea? Do we need to perform a SQL > query to get the required slot properties and then compare it with > current subscription properties? I considered that too, as mentioned up-thread. My concern is that the slot could be changed or recreated between the query and its acquisition by START_REPLICATION. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
