Re: Fix slot synchronization with two_phase decoding enabled

shveta malik <shveta.malik@gmail.com>

From: shveta malik <shveta.malik@gmail.com>
To: Nisha Moond <nisha.moond412@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, shveta malik <shveta.malik@gmail.com>
Date: 2025-05-07T05:01:55Z
Lists: pgsql-hackers
On Mon, May 5, 2025 at 3:29 PM Nisha Moond <nisha.moond412@gmail.com> wrote:
>
> Please find the v12 patch with above suggested changes.
>

Thanks for the patch. Few comments for doc changes:

1)
func.sgml - pg_create_logical_replication_slot:

+        failover. The parameters <parameter>twophase</parameter> and
+        <parameter>failover</parameter> cannot be enabled together when
+        creating a replication slot. However, a slot created with
<parameter>twophase</parameter>
+        enabled can later have <parameter>failover</parameter> set to true
+        either using <command>ALTER_REPLICATION_SLOT</command> or via
+        <command>ALTER SUBSCRIPTION</command> if a subscription is using this
+        slot.

Will it be better if we make a NOTE for this? Also can we create links for
<command>ALTER SUBSCRIPTION</command> and
<command>ALTER_REPLICATION_SLOT</command>?

2)
protocol.sgml:

+          The default is false. This option cannot be set together with
+          <literal>failover</literal> when creating a logical replication slot.
+          However, once the slot is created with <literal>two_phase =
true</literal>,
+          <literal>failover</literal> can be set to true after the slot has
+          consumed all the changes up to the point where two-phase decoding
+          was enabled.

Can we make a new paragraph for the new restriction added. Same for
other new restriction in this page.

3)
create_subscription.sgml:

+          cannot be enabled together when creating a subscription. However, a
+          <literal>two_phase</literal> enabled subscription can later have
+          <literal>failover</literal> set to true via <command>ALTER
SUBSCRIPTION</command>,

via-->using

thanks
Shveta



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.