pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow enabling two-phase option via replication protocol.
Date: Wed, 30 Jun 2021 03:26:43 +0000
Message-ID: <E1lyQs7-0004cs-Bo@gemulon.postgresql.org> (raw)

Allow enabling two-phase option via replication protocol.

Extend the replication command CREATE_REPLICATION_SLOT to support the
TWO_PHASE option. This will allow decoding commands like PREPARE
TRANSACTION, COMMIT PREPARED and ROLLBACK PREPARED for slots created with
this option. The decoding of the transaction happens at prepare command.

This patch also adds support of two-phase in pg_recvlogical via a new
option --two-phase.

This option will also be used by future patches that allow streaming of
transactions at prepare time for built-in logical replication. With this,
the out-of-core logical replication solutions can enable replication of
two-phase transactions via replication protocol.

Author: Ajin Cherian
Reviewed-By: Jeff Davis, Vignesh C, Amit Kapila
Discussion:
https://postgr.es/m/02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru
https://postgr.es/m/64b9f783c6e125f18f88fbc0c0234e34e71d8639.camel@j-davis.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cda03cfed6b8bd5f64567bccbc9578fba035691e

Modified Files
--------------
doc/src/sgml/logicaldecoding.sgml             | 23 ++++++++++++--
doc/src/sgml/protocol.sgml                    | 16 +++++++++-
doc/src/sgml/ref/pg_recvlogical.sgml          | 16 ++++++++++
src/backend/replication/repl_gram.y           |  6 ++++
src/backend/replication/repl_scanner.l        |  1 +
src/backend/replication/walsender.c           | 18 +++++++++--
src/bin/pg_basebackup/pg_basebackup.c         |  2 +-
src/bin/pg_basebackup/pg_receivewal.c         |  2 +-
src/bin/pg_basebackup/pg_recvlogical.c        | 19 +++++++++--
src/bin/pg_basebackup/streamutil.c            |  6 +++-
src/bin/pg_basebackup/streamutil.h            |  2 +-
src/bin/pg_basebackup/t/030_pg_recvlogical.pl | 45 ++++++++++++++++++++++++++-
12 files changed, 143 insertions(+), 13 deletions(-)



Message-ID: <E1lyQs7-0004cs-Bo@gemulon.postgresql.org>
Permalink:  ../E1lyQs7-0004cs-Bo@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lyQs7-0004cs-Bo@gemulon.postgresql.org

 · 

reply

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: Allow enabling two-phase option via replication protocol.
  In-Reply-To: <E1lyQs7-0004cs-Bo@gemulon.postgresql.org>
  References: <E1lyQs7-0004cs-Bo@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