git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 66f1630) | patch
Add support for streaming to built-in logical replication.
Thu, 3 Sep 2020 02:24:07 +0000 (07:54 +0530)
Thu, 3 Sep 2020 02:24:07 +0000 (07:54 +0530)
commit 464824323e57dc4b397e8b05854d779908b55304
Add support for streaming to built-in logical replication.

To add support for streaming of in-progress transactions into the
built-in logical replication, we need to do three things:

* Extend the logical replication protocol, so identify in-progress
transactions, and allow adding additional bits of information (e.g.
XID of subtransactions).

* Modify the output plugin (pgoutput) to implement the new stream
API callbacks, by leveraging the extended replication protocol.

* Modify the replication apply worker, to properly handle streamed
in-progress transaction by spilling the data to disk and then
replaying them on commit.

We however must explicitly disable streaming replication during
replication slot creation, even if the plugin supports it. We
don't need to replicate the changes accumulated during this phase,
and moreover we don't have a replication connection open so we
don't have where to send the data anyway.

Author: Tomas Vondra, Dilip Kumar and Amit Kapila
Reviewed-by: Amit Kapila, Kuntal Ghosh and Ajin Cherian
Tested-by: Neha Sharma, Mahendra Singh Thalor and Ajin Cherian
Discussion: https://postgr.es/m/688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com
23 files changed:
doc/src/sgml/monitoring.sgml diff | blob | blame | history
doc/src/sgml/ref/alter_subscription.sgml diff | blob | blame | history
doc/src/sgml/ref/create_subscription.sgml diff | blob | blame | history
src/backend/catalog/pg_subscription.c diff | blob | blame | history
src/backend/catalog/system_views.sql diff | blob | blame | history
src/backend/commands/subscriptioncmds.c diff | blob | blame | history
src/backend/postmaster/pgstat.c diff | blob | blame | history
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c diff | blob | blame | history
src/backend/replication/logical/proto.c diff | blob | blame | history
src/backend/replication/logical/worker.c diff | blob | blame | history
src/backend/replication/pgoutput/pgoutput.c diff | blob | blame | history
src/bin/pg_dump/pg_dump.c diff | blob | blame | history
src/bin/pg_dump/pg_dump.h diff | blob | blame | history
src/bin/psql/describe.c diff | blob | blame | history
src/include/catalog/catversion.h diff | blob | blame | history
src/include/catalog/pg_subscription.h diff | blob | blame | history
src/include/pgstat.h diff | blob | blame | history
src/include/replication/logicalproto.h diff | blob | blame | history
src/include/replication/walreceiver.h diff | blob | blame | history
src/test/regress/expected/subscription.out diff | blob | blame | history
src/test/regress/sql/subscription.sql diff | blob | blame | history
src/test/subscription/t/015_stream.pl [new file with mode: 0644] blob
src/tools/pgindent/typedefs.list diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /