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

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 774d47b) | patch
Allow altering of two_phase option of a SUBSCRIPTION.
2024年7月24日 04:43:36 +0000 (10:13 +0530)
2024年7月24日 04:43:36 +0000 (10:13 +0530)
commit 1462aad2e4474ab61174f8ab00992cd3d6d57c7b
Allow altering of two_phase option of a SUBSCRIPTION.

The two_phase option is controlled by both the publisher (as a slot
option) and the subscriber (as a subscription option), so the slot option
must also be modified.

Changing the 'two_phase' option for a subscription from 'true' to 'false'
is permitted only when there are no pending prepared transactions
corresponding to that subscription. Otherwise, the changes of already
prepared transactions can be replicated again along with their corresponding
commit leading to duplicate data or errors.

To avoid data loss, the 'two_phase' option for a subscription can only be
changed from 'false' to 'true' once the initial data synchronization is
completed. Therefore this is performed later by the logical replication worker.

Author: Hayato Kuroda, Ajin Cherian, Amit Kapila
Reviewed-by: Peter Smith, Hou Zhijie, Amit Kapila, Vitaly Davydov, Vignesh C
Discussion: https://postgr.es/m/8fab8-65d74c80-1-2f28e880@39088166
17 files changed:
doc/src/sgml/protocol.sgml diff | blob | blame | history
doc/src/sgml/ref/alter_subscription.sgml diff | blob | blame | history
src/backend/access/transam/twophase.c diff | blob | blame | history
src/backend/commands/subscriptioncmds.c diff | blob | blame | history
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c diff | blob | blame | history
src/backend/replication/logical/launcher.c diff | blob | blame | history
src/backend/replication/logical/worker.c diff | blob | blame | history
src/backend/replication/slot.c diff | blob | blame | history
src/backend/replication/walsender.c diff | blob | blame | history
src/bin/psql/tab-complete.c diff | blob | blame | history
src/include/access/twophase.h diff | blob | blame | history
src/include/replication/slot.h diff | blob | blame | history
src/include/replication/walreceiver.h diff | blob | blame | history
src/include/replication/worker_internal.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/021_twophase.pl diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

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