From 9f2213a7c575bae43a2d41abc8b60770066ca81c Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Thu, 2 Feb 2023 08:15:18 +0530 Subject: Allow the logical_replication_mode to be used on the subscriber. Extend the existing developer option 'logical_replication_mode' to help test the parallel apply of large transactions on the subscriber. When set to 'buffered', the leader sends changes to parallel apply workers via a shared memory queue. When set to 'immediate', the leader serializes all changes to files and notifies the parallel apply workers to read and apply them at the end of the transaction. This helps in adding tests to cover the serialization code path in parallel streaming mode. Author: Hou Zhijie Reviewed-by: Peter Smith, Kuroda Hayato, Sawada Masahiko, Amit Kapila Discussion: https://postgr.es/m/CAA4eK1+wyN6zpaHUkCLorEWNx75MG0xhMwcFhvjqm2KURZEAGw@mail.gmail.com --- doc/src/sgml/config.sgml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 1cf53c74ea6..186edaffd5a 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -11701,22 +11701,35 @@ LOG: CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1) - Allows streaming or serializing changes immediately in logical decoding. - The allowed values of logical_replication_mode are - buffered and immediate. When set - to immediate, stream each change if + The allowed values are buffered and + immediate. The default is buffered. + This parameter is intended to be used to test logical decoding and + replication of large transactions. The effect of + logical_replication_mode is different for the + publisher and subscriber: + + + + On the publisher side, logical_replication_mode + allows streaming or serializing changes immediately in logical decoding. + When set to immediate, stream each change if the streaming option (see optional parameters set by CREATE SUBSCRIPTION) is enabled, otherwise, serialize each change. When set to - buffered, which is the default, decoding will stream - or serialize changes when logical_decoding_work_mem - is reached. + buffered, the decoding will stream or serialize + changes when logical_decoding_work_mem is reached. + - This parameter is intended to be used to test logical decoding and - replication of large transactions for which otherwise we need to - generate the changes till logical_decoding_work_mem - is reached. + On the subscriber side, if the streaming option is set to + parallel, logical_replication_mode + can be used to direct the leader apply worker to send changes to the + shared memory queue or to serialize all changes to the file. When set to + buffered, the leader sends changes to parallel apply + workers via a shared memory queue. When set to + immediate, the leader serializes all changes to files + and notifies the parallel apply workers to read and apply them at the + end of the transaction. -- cgit v1.2.3