diff options
author | Amit Kapila <akapila@postgresql.org> | 2023-02-02 08:15:18 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2023-02-02 08:15:18 +0530 |
commit | 9f2213a7c575bae43a2d41abc8b60770066ca81c (patch) | |
tree | 5456fdc30b648c117a14f863d2c2857307485cd2 /doc/src | |
parent | fb1a59de0c52609653166aafc6ce8679a9cfe54b (diff) | |
download | postgresql-9f2213a7c575bae43a2d41abc8b60770066ca81c.tar.gz postgresql-9f2213a7c575bae43a2d41abc8b60770066ca81c.zip |
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
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/config.sgml | 35 |
1 files changed, 24 insertions, 11 deletions
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) </term> <listitem> <para> - Allows streaming or serializing changes immediately in logical decoding. - The allowed values of <varname>logical_replication_mode</varname> are - <literal>buffered</literal> and <literal>immediate</literal>. When set - to <literal>immediate</literal>, stream each change if + The allowed values are <literal>buffered</literal> and + <literal>immediate</literal>. The default is <literal>buffered</literal>. + This parameter is intended to be used to test logical decoding and + replication of large transactions. The effect of + <varname>logical_replication_mode</varname> is different for the + publisher and subscriber: + </para> + + <para> + On the publisher side, <varname>logical_replication_mode</varname> + allows streaming or serializing changes immediately in logical decoding. + When set to <literal>immediate</literal>, stream each change if the <literal>streaming</literal> option (see optional parameters set by <link linkend="sql-createsubscription"><command>CREATE SUBSCRIPTION</command></link>) is enabled, otherwise, serialize each change. When set to - <literal>buffered</literal>, which is the default, decoding will stream - or serialize changes when <varname>logical_decoding_work_mem</varname> - is reached. + <literal>buffered</literal>, the decoding will stream or serialize + changes when <varname>logical_decoding_work_mem</varname> is reached. </para> + <para> - 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 <varname>logical_decoding_work_mem</varname> - is reached. + On the subscriber side, if the <literal>streaming</literal> option is set to + <literal>parallel</literal>, <varname>logical_replication_mode</varname> + 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 + <literal>buffered</literal>, the leader sends changes to parallel apply + workers via a shared memory queue. When set to + <literal>immediate</literal>, the leader serializes all changes to files + and notifies the parallel apply workers to read and apply them at the + end of the transaction. </para> </listitem> </varlistentry> |