Hi,

On Thu, Oct 29, 2026 at 03:04:12PM +0800, Zhijie Hou wrote:
> Agreed. I adjusted the test order to make it clear.
> 
> Here is the V2 patch.

Thanks for the patch!

+         /*
+          * Change system catalog accordingly, but do not reset the
+          * state to PENDING if two_phase is already enabled.
+          */
+          if (!(opts.twophase &&
+                sub->twophasestate == LOGICALREP_TWOPHASE_STATE_ENABLED))

The new condition also preserves 'e' when slot_name changes. In that case, a
replacement slot with two_phase=false remains false because the worker does not
go through the PENDING state.

I reproduced this with:

ALTER SUBSCRIPTION sub SET (slot_name = 'replacement', two_phase = true);

Should we preserve 'e' only when the slot name is unchanged?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com


Reply via email to