From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add prepare API support for streaming transactions in logical re
Date: Wed, 04 Aug 2021 02:47:02 +0000
Message-ID: <E1mB6vu-0000iy-Sc@gemulon.postgresql.org> (raw)
Add prepare API support for streaming transactions in logical replication.
Commit a8fd13cab0 added support for prepared transactions to built-in
logical replication via a new option "two_phase" for a subscription. The
"two_phase" option was not allowed with the existing streaming option.
This commit permits the combination of "streaming" and "two_phase"
subscription options. It extends the pgoutput plugin and the subscriber
side code to add the prepare API for streaming transactions which will
apply the changes accumulated in the spool-file at prepare time.
Author: Peter Smith and Ajin Cherian
Reviewed-by: Vignesh C, Amit Kapila, Greg Nancarrow
Tested-By: Haiying Tang
Discussion: https://postgr.es/m/02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru
Discussion: https://postgr.es/m/CAMGcDxeqEpWj3fTXwqhSwBdXd2RS9jzwWscO-XbeCfso6ts3+Q@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/63cf61cdeb7b0450dcf3b2f719c553177bac85a2
Modified Files
--------------
doc/src/sgml/logicaldecoding.sgml | 11 +-
doc/src/sgml/protocol.sgml | 76 ++++++-
doc/src/sgml/ref/create_subscription.sgml | 10 -
src/backend/commands/subscriptioncmds.c | 25 ---
src/backend/replication/logical/proto.c | 29 ++-
src/backend/replication/logical/worker.c | 56 ++++-
src/backend/replication/pgoutput/pgoutput.c | 33 ++-
src/include/replication/logicalproto.h | 8 +-
src/test/regress/expected/subscription.out | 24 +-
src/test/regress/sql/subscription.sql | 11 +-
src/test/subscription/t/022_twophase_cascade.pl | 179 ++++++++++++++-
src/test/subscription/t/023_twophase_stream.pl | 284 ++++++++++++++++++++++++
12 files changed, 667 insertions(+), 79 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: akapila@postgresql.org
Subject: Re: pgsql: Add prepare API support for streaming transactions in logical re
In-Reply-To: <E1mB6vu-0000iy-Sc@gemulon.postgresql.org>
References: <E1mB6vu-0000iy-Sc@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox