Re: [HACKERS] logical decoding of two-phase transactions

From: Ajin Cherian <itsajin(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Date: 2021-03-08 06:00:45
Message-ID: CAFPTHDYJkWWcxvL9L=vScVwKCU927Rq=0v-6R7-RR7A4yaut8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 5, 2021 at 9:25 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:

> Thanks for the updated patch.
> Few minor comments:

> We should include two_phase in tab completion (tab-complete.c file
> psql_completion(const char *text, int start, int end) function) :
> postgres=# create subscription sub1 connection 'port=5441
> dbname=postgres' publication pub1 with (
> CONNECT COPY_DATA CREATE_SLOT ENABLED
> SLOT_NAME SYNCHRONOUS_COMMIT
>

Updated.
> +
> + <para>
> + It is not allowed to combine <literal>streaming</literal> set to
> + <literal>true</literal> and <literal>two_phase</literal> set to
> + <literal>true</literal>.
> + </para>
> +
> + </listitem>
> + </varlistentry>
> + <varlistentry>
> + <term><literal>two_phase</literal> (<type>boolean</type>)</term>
> + <listitem>
> + <para>
> + Specifies whether two-phase commit is enabled for this subscription.
> + The default is <literal>false</literal>.
> + </para>
> +
> + <para>
> + When two-phase commit is enabled then the decoded
> transactions are sent
> + to the subscriber on the PREPARE TRANSACTION. By default,
> the transaction
> + preapred on publisher is decoded as normal transaction at commit.
> + </para>
> +
> + <para>
> + It is not allowed to combine <literal>two_phase</literal> set to
> + <literal>true</literal> and <literal>streaming</literal> set to
> + <literal>true</literal>.
> + </para>
>
> It is not allowed to combine streaming set to true and two_phase set to true.
> Should this be:
> streaming option is not supported along with two_phase option.
>
> Similarly here too:
> It is not allowed to combine two_phase set to true and streaming set to true.
> Should this be:
> two_phase option is not supported along with streaming option.

Reworded this with a small change.

>
> Few indentation issues are present, we can run pgindent:
> +extern void logicalrep_write_prepare(StringInfo out, ReorderBufferTXN *txn,
> +
> XLogRecPtr prepare_lsn);
> +extern void logicalrep_read_prepare(StringInfo in,
> +
> LogicalRepPreparedTxnData *prepare_data);
> +extern void logicalrep_write_commit_prepared(StringInfo out,
> ReorderBufferTXN* txn,
> +
> XLogRecPtr commit_lsn);
>
> ReorderBufferTXN * should be ReorderBufferTXN*

Changed accordingly.

Created new patch v53:
* Rebased to HEAD (this resulted in removing patch 0001) and reduced
patch-set to 4 patches.
* Removed the changes for making "stream prepare" optional from
required. Will create a new patch and thread for this.

regards,
Ajin Cherian
Fujitsu Australia

Attachment Content-Type Size
v53-0001-Add-support-for-apply-at-prepare-time-to-built-i.patch application/octet-stream 62.2 KB
v53-0004-Fix-apply-worker-empty-prepare-dev-logs.patch application/octet-stream 14.0 KB
v53-0002-Support-2PC-txn-subscriber-tests.patch application/octet-stream 24.3 KB
v53-0003-Support-2PC-txn-Subscription-option.patch application/octet-stream 36.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Nancarrow 2021-03-08 06:26:34 Re: Parallel INSERT (INTO ... SELECT ...)
Previous Message vignesh C 2021-03-08 05:58:46 Re: [HACKERS] logical decoding of two-phase transactions