Thread: pg_recvlogical cannot create slots with failover=true

pg_recvlogical cannot create slots with failover=true

From
"Hayato Kuroda (Fujitsu)"
Date:
Dear hackers,

While reviewing threads I found $SUBJECT.

I think it does not affect to output, but I could not find strong reasons not to
support it. Also, this can be used for testing purpose, i.e., DBAs can verify the
slot-sync can work on their system by only using pg_recvlogical.

Attached patch implements it. Since -f/-F option has already been used, -O was
chosen for the short-version. Better idea is very welcomed.

How do you feel?

Best regards,
Hayato Kuroda
FUJITSU LIMITED


Attachment

Re: pg_recvlogical cannot create slots with failover=true

From
Michael Banck
Date:
Hi,

On Tue, Apr 01, 2025 at 08:01:32AM +0000, Hayato Kuroda (Fujitsu) wrote:
> Attached patch implements it. Since -f/-F option has already been used, -O was
> chosen for the short-version. Better idea is very welcomed.

Maybe we don't need a short option at all for this, at least initially?


Michael



RE: pg_recvlogical cannot create slots with failover=true

From
"Hayato Kuroda (Fujitsu)"
Date:
Dear Michael,

> Maybe we don't need a short option at all for this, at least initially?

Indeed, updated.

Best regards,
Hayato Kuroda
FUJITSU LIMITED


Attachment

Re: pg_recvlogical cannot create slots with failover=true

From
Masahiko Sawada
Date:
On Wed, Apr 2, 2025 at 11:57 PM Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
>
> Dear Michael,
>
> > Maybe we don't need a short option at all for this, at least initially?
>
> Indeed, updated.

Thank you for updating the patch. Here are some minor comments:

         The <option>--two-phase</option> can be specified with
         <option>--create-slot</option> to enable decoding of prepared
transactions.
+        Also, <option>--falover</option> can be specified with
+        <option>--create-slot</option> to create replication slot which can be
+        synchronized to the standby.

How about rewording the whole sentence like:

+        The <option>--two-phase</option> and
<option>--failover</option> options
+        can be specified with <option>--create-slot</option>.

Explaining both options here seems redundant to me.

---
+       <para>
+        Allows created replication slot to be synchronized to the standbys.
+        This option may only be specified with <option>--create-slot</option>.
+       </para>

How about slightly rewording to like:

+        Enables the slot to be synchronized to the standbys. This
option may only be
+        specified with <option>--create-slot</option>.

Also, the descriptions of pg_recvlogical options are written in
alphabetical order. Please put the description for --failover option
after -E/--endpos.

The rest looks good to me.

Regards,


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



RE: pg_recvlogical cannot create slots with failover=true

From
"Hayato Kuroda (Fujitsu)"
Date:
Dear Sawada-san,

> Thank you for updating the patch. Here are some minor comments:
> 
>          The <option>--two-phase</option> can be specified with
>          <option>--create-slot</option> to enable decoding of prepared
> transactions.
> +        Also, <option>--falover</option> can be specified with
> +        <option>--create-slot</option> to create replication slot which can
> be
> +        synchronized to the standby.
> 
> How about rewording the whole sentence like:
> 
> +        The <option>--two-phase</option> and
> <option>--failover</option> options
> +        can be specified with <option>--create-slot</option>.
> 
> Explaining both options here seems redundant to me.

Fixed.

> ---
> +       <para>
> +        Allows created replication slot to be synchronized to the standbys.
> +        This option may only be specified with
> <option>--create-slot</option>.
> +       </para>
> 
> How about slightly rewording to like:
> 
> +        Enables the slot to be synchronized to the standbys. This
> option may only be
> +        specified with <option>--create-slot</option>.

Fixed. The description in usage() is adjusted based on this.

> Also, the descriptions of pg_recvlogical options are written in
> alphabetical order. Please put the description for --failover option
> after -E/--endpos.

Right. I put because it had short-term '-o' in old version, but it was removed.
Fixed.

PSA new version.

Best regards,
Hayato Kuroda
FUJITSU LIMITED


Attachment

Re: pg_recvlogical cannot create slots with failover=true

From
Masahiko Sawada
Date:
On Thu, Apr 3, 2025 at 8:28 PM Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
>
> Dear Sawada-san,
>
> > Thank you for updating the patch. Here are some minor comments:
> >
> >          The <option>--two-phase</option> can be specified with
> >          <option>--create-slot</option> to enable decoding of prepared
> > transactions.
> > +        Also, <option>--falover</option> can be specified with
> > +        <option>--create-slot</option> to create replication slot which can
> > be
> > +        synchronized to the standby.
> >
> > How about rewording the whole sentence like:
> >
> > +        The <option>--two-phase</option> and
> > <option>--failover</option> options
> > +        can be specified with <option>--create-slot</option>.
> >
> > Explaining both options here seems redundant to me.
>
> Fixed.
>
> > ---
> > +       <para>
> > +        Allows created replication slot to be synchronized to the standbys.
> > +        This option may only be specified with
> > <option>--create-slot</option>.
> > +       </para>
> >
> > How about slightly rewording to like:
> >
> > +        Enables the slot to be synchronized to the standbys. This
> > option may only be
> > +        specified with <option>--create-slot</option>.
>
> Fixed. The description in usage() is adjusted based on this.
>
> > Also, the descriptions of pg_recvlogical options are written in
> > alphabetical order. Please put the description for --failover option
> > after -E/--endpos.
>
> Right. I put because it had short-term '-o' in old version, but it was removed.
> Fixed.

Thank you for updating the patch! Pushed with small cosmetic changes.

Regards,

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