pgsql: Add two-phase option in pg_createsubscriber.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add two-phase option in pg_createsubscriber.
Date: 2025-02-26 05:55:35
Message-ID: E1tnAOM-00085d-1D@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add two-phase option in pg_createsubscriber.

This patch introduces the '--enable-two-phase' option to the
'pg_createsubscriber' utility, allowing users to enable two-phase commit
for all subscriptions during their creation.

Note that even without this option users can enable the two_phase option
for the subscriptions created by pg_createsubscriber. However, it requires
the subscription to be disabled first which could be inconvenient for
users.

When two-phase commit is enabled, prepared transactions are sent to the
subscriber at the time of 'PREPARE TRANSACTION', and they are processed as
two-phase transactions on the subscriber as well. If disabled, prepared
transactions are sent only when committed and are processed immediately by
the subscriber.

Author: Shubham Khanna <khannashubham1197(at)gmail(dot)com>
Reviewed-by: vignesh C <vignesh21(at)gmail(dot)com>
Reviewed-by: Hayato Kuroda <kuroda(dot)hayato(at)fujitsu(dot)com>
Reviewed-by: Peter Smith <smithpb2250(at)gmail(dot)com>
Reviewed-by: Ajin Cherian <itsajin(at)gmail(dot)com>
Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAHv8RjLPdFP=kA5LNSmWZ=+GMXmO+LczvV6p9HJjsXxZz10KGA@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/ref/pg_createsubscriber.sgml | 18 ++++-
src/bin/pg_basebackup/pg_createsubscriber.c | 84 ++++++++++++++--------
src/bin/pg_basebackup/t/040_pg_createsubscriber.pl | 11 +++
3 files changed, 83 insertions(+), 30 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-02-26 06:37:53 pgsql: Remove pgstat_flush_wal()
Previous Message Michael Paquier 2025-02-26 05:27:22 pgsql: Improve FATAL message for invalid TLI history at recovery