From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add a failover option to subscriptions.
Date: Tue, 30 Jan 2024 11:31:45 +0000
Message-ID: <E1rUmLB-003ptW-UP@gemulon.postgresql.org> (raw)
Add a failover option to subscriptions.
This commit introduces a new subscription option named 'failover', which
provides users with the ability to set the failover property of the
replication slot on the publisher when creating or altering a
subscription.
This uses the replication commands introduced by commit 7329240437 to
enable the failover option for a logical replication slot.
If the failover option is set to true, the associated replication slots
(i.e. the main slot and the table sync slots) in the upstream database are
enabled to be synchronized to the standbys. Note that the capability to
sync the replication slots will be added in subsequent commits.
Thanks to Masahiko Sawada for the design inputs.
Author: Shveta Malik, Hou Zhijie, Ajin Cherian
Reviewed-by: Peter Smith, Bertrand Drouvot, Dilip Kumar, Masahiko Sawada, Nisha Moond, Kuroda Hayato, Amit Kapila
Discussion: https://postgr.es/m/514f6f2f-6833-4539-39f1-96cd1e011f23@enterprisedb.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/776621a5e4796fa214b6b29a7ca134f6c138572a
Modified Files
--------------
doc/src/sgml/catalogs.sgml | 11 ++
doc/src/sgml/ref/alter_subscription.sgml | 25 +++-
doc/src/sgml/ref/create_subscription.sgml | 23 ++-
doc/src/sgml/ref/pg_dump.sgml | 8 +-
src/backend/catalog/pg_subscription.c | 1 +
src/backend/catalog/system_views.sql | 2 +-
src/backend/commands/subscriptioncmds.c | 116 +++++++++++++++-
src/backend/replication/logical/tablesync.c | 2 +-
src/backend/replication/logical/worker.c | 7 +
src/bin/pg_dump/pg_dump.c | 21 ++-
src/bin/pg_dump/pg_dump.h | 1 +
src/bin/pg_upgrade/t/003_logical_slots.pl | 6 +-
src/bin/pg_upgrade/t/004_subscription.pl | 18 +--
src/bin/psql/describe.c | 8 +-
src/bin/psql/tab-complete.c | 4 +-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_subscription.h | 9 ++
src/test/recovery/meson.build | 1 +
.../recovery/t/040_standby_failover_slots_sync.pl | 100 +++++++++++++
src/test/regress/expected/subscription.out | 154 +++++++++++----------
src/test/regress/sql/subscription.sql | 1 +
21 files changed, 412 insertions(+), 108 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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Add a failover option to subscriptions.
In-Reply-To: <E1rUmLB-003ptW-UP@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