Re: Fix slot synchronization with two_phase decoding enabled

Masahiko Sawada <sawada.mshk@gmail.com>

From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Nisha Moond <nisha.moond412@gmail.com>, shveta malik <shveta.malik@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-06-05T07:43:49Z
Lists: pgsql-hackers
On Wed, Jun 4, 2025 at 10:46 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> On Sun, Jun 1, 2025 at 10:25 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> >
> > Yet another idea is to dump the subscription with two_phase = on and
> > failover = false. We should do this when both options are 'true'
> > during the dump.  As we are documenting that we always dump
> > createsubscription with connect as false and let users take care (see
> > [1] (When dumping logical replication subscriptions ...)), a similar
> > reasoning could be given for the failover flag.
>
> It probably would work for subscriptions but what about logical slots?
> If we restore two_phase=on and failover=false, the user would have to
> enable the failover via ALTER_REPLICATION_SLOT. I think we should
> avoid asking users to execute the replication commands directly.
>

Sorry, I mixed manually creating a logical slot and restoring a dump,
and I think we've already discussed that. Please ignore this comment.

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com



Commits

  1. Don't retreat slot's confirmed_flush LSN.

  2. Fix assertion failure during decoding from synced slots.

  3. Fix xmin advancement during fast_forward decoding.

  4. Fix slot synchronization for two_phase enabled slots.

  5. Again match pg_user_mappings to information_schema.user_mapping_options.