Re: Decoding of two-phase xacts missing from CREATE_REPLICATION_SLOT command - Mailing list pgsql-hackers

From Ajin Cherian
Subject Re: Decoding of two-phase xacts missing from CREATE_REPLICATION_SLOT command
Date
Msg-id CAFPTHDb3c=ZEtnMhwf9xi_PnH1e5LWF7wxFGxAZ-e-4fV9DsXw@mail.gmail.com
Whole thread Raw
In response to Re: Decoding of two-phase xacts missing from CREATE_REPLICATION_SLOT command  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Decoding of two-phase xacts missing from CREATE_REPLICATION_SLOT command  (Ajin Cherian <itsajin@gmail.com>)
List pgsql-hackers
On Fri, Jun 11, 2021 at 8:14 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>

> Also, I can take care of the below cosmetic issues before committing
> if we decide to do this for PG-14.
>
> Few cosmetic issues:
> ==================
> 1. git diff --check shows
> src/bin/pg_basebackup/t/030_pg_recvlogical.pl:109: new blank line at EOF.
>
> 2.
> +
>    <para>
>    The following example shows SQL interface that can be used to decode prepared
>    transactions. Before you use two-phase commit commands, you must set
>
> Spurious line addition.
>

Fixed.

> 3.
> /* Build query */
>   appendPQExpBuffer(query, "CREATE_REPLICATION_SLOT \"%s\"", slot_name);
>   if (is_temporary)
>   appendPQExpBufferStr(query, " TEMPORARY");
> +
>   if (is_physical)
>
> Spurious line addition.
>

Fixed.

> 4.
>   appendPQExpBuffer(query, " LOGICAL \"%s\"", plugin);
> + if (two_phase && PQserverVersion(conn) >= 140000)
> + appendPQExpBufferStr(query, " TWO_PHASE");
> +
>   if (PQserverVersion(conn) >= 100000)
>   /* pg_recvlogical doesn't use an exported snapshot, so suppress */
>   appendPQExpBufferStr(query, " NOEXPORT_SNAPSHOT");
>
> I think it might be better to append TWO_PHASE after NOEXPORT_SNAPSHOT
> but it doesn't matter much.
>

I haven't changed this, I like to keep it this way.

> 5.
> +$node->safe_psql('postgres',
> + "BEGIN;INSERT INTO test_table values (11); PREPARE TRANSACTION 'test'");
>
> There is no space after BEGIN but there is a space after INSERT. For
> consistency-sake, I will have space after BEGIN as well.

Changed this.

regards,
Ajin Cherian
Fujitsu Australia

Attachment

pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Refactor "mutually exclusive options" error reporting code in parse_subscription_options
Next
From: Laurenz Albe
Date:
Subject: Re: Use singular number when appropriate