RE: pg_recvlogical cannot create slots with failover=true

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Amit Kapila' <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: pg_recvlogical cannot create slots with failover=true
Date: 2025-06-17 03:21:19
Message-ID: OSCPR01MB149663558EBB2E1499889E31AF573A@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Amit, Sawada, Peter,

> > > I wonder if the option name --failover is ideal. To me, it sounds like
> > > an action "do a failover!". Also consider that pg_recvlogical has other
> > > action options such as --start and --create-slot, so it sounds a bit
> > > like those.
> >
> > Fair point.
> >
> > > Maybe something like --enable-failover would be better?
> >
> > Sounds better, but probably the --two-phase option has the same issue?
> >
>
> Ideally, we should change both to maintain consistency across various
> slot options. OTOH, as we have already described these options as: "
> The --two-phase and --failover options can be specified with
> --create-slot.", it is clear that these are slot options. The previous
> version docs have a description: "The --two-phase can be specified
> with --create-slot to enable decoding of prepared transactions." which
> makes it even more clear that the two-phase is a slot option. The
> options are named similarly in pg_create_logical_replication_slot API
> and during CREATE SUBSCRIPTION, so, to some level, there is a
> consistency in naming of these options across all APIs/tools. But,
> their usage in a tool like pg_recvlogical could be perceived
> differently as well, so it is also okay to consider naming them
> differently.

Either name is fine for me, but I have a concern for the description. Now the
documentation says:

```
-t
--two-phase
Enables decoding of prepared transactions. This option may only be specified with --create-slot.
```

If we clarify the option is aimed for the slot, should we follow the
description in the protocol.sgml? I.e.,

```
-t
--two-phase
the slot supports decoding of two-phase commit. This option may only be specified with --create-slot.
```

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-06-17 03:34:28 Re: Allow pg_dump --statistics-only to dump foreign table statistics?
Previous Message Yan Haibo 2025-06-17 03:12:38 回复: 回复: 回复: Fix potential overflow risks from wcscpy and sprintf