diff options
author | Amit Kapila <akapila@postgresql.org> | 2020-09-03 07:54:07 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2020-09-03 07:54:07 +0530 |
commit | 464824323e57dc4b397e8b05854d779908b55304 (patch) | |
tree | 30a02506ae6b53475302980bc558e2a41ea429f0 /doc/src | |
parent | 66f163068030b5c5fe792a0daee27822dac43791 (diff) | |
download | postgresql-464824323e57dc4b397e8b05854d779908b55304.tar.gz postgresql-464824323e57dc4b397e8b05854d779908b55304.zip |
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
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/monitoring.sgml | 16 | ||||
-rw-r--r-- | doc/src/sgml/ref/alter_subscription.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/ref/create_subscription.sgml | 11 |
3 files changed, 30 insertions, 2 deletions
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index d973e1149aa..673a0e73e45 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -1509,6 +1509,22 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser <entry><literal>WALWrite</literal></entry> <entry>Waiting for a write to a WAL file.</entry> </row> + <row> + <entry><literal>LogicalChangesRead</literal></entry> + <entry>Waiting for a read from a logical changes file.</entry> + </row> + <row> + <entry><literal>LogicalChangesWrite</literal></entry> + <entry>Waiting for a write to a logical changes file.</entry> + </row> + <row> + <entry><literal>LogicalSubxactRead</literal></entry> + <entry>Waiting for a read from a logical subxact file.</entry> + </row> + <row> + <entry><literal>LogicalSubxactWrite</literal></entry> + <entry>Waiting for a write to a logical subxact file.</entry> + </row> </tbody> </tgroup> </table> diff --git a/doc/src/sgml/ref/alter_subscription.sgml b/doc/src/sgml/ref/alter_subscription.sgml index 81c4e70cdf4..a1666b370be 100644 --- a/doc/src/sgml/ref/alter_subscription.sgml +++ b/doc/src/sgml/ref/alter_subscription.sgml @@ -165,8 +165,9 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO < <xref linkend="sql-createsubscription"/>. See there for more information. The parameters that can be altered are <literal>slot_name</literal>, - <literal>synchronous_commit</literal>, and - <literal>binary</literal>. + <literal>synchronous_commit</literal>, + <literal>binary</literal>, and + <literal>streaming</literal>. </para> </listitem> </varlistentry> diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index cdb22c54fea..b7d7457d004 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -228,6 +228,17 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl </para> </listitem> </varlistentry> + <varlistentry> + <term><literal>streaming</literal> (<type>boolean</type>)</term> + <listitem> + <para> + Specifies whether streaming of in-progress transactions should + be enabled for this subscription. By default, all transactions + are fully decoded on the publisher, and only then sent to the + subscriber as a whole. + </para> + </listitem> + </varlistentry> </variablelist></para> </listitem> </varlistentry> |