Commit 15c1a9d9 authored by Amit Kapila's avatar Amit Kapila

doc: Update information of new messages for logical replication.

Updated documentation for new messages added for streaming of in-progress
transactions, as well as changes made to the existing messages. It also
updates the information of protocol versions supported for logical
replication.

Author: Ajin Cherian
Reviewed-by: Amit Kapila, Peter Smith, Euler Taveira
Discussion: https://postgr.es/m/CAFPTHDYHN9m=MZZct-B=BYg_TETvv+kXvL9RD2DpaBS5pGxGYg@mail.gmail.com
parent 7a397259
...@@ -2797,8 +2797,10 @@ The commands accepted in replication mode are: ...@@ -2797,8 +2797,10 @@ The commands accepted in replication mode are:
</term> </term>
<listitem> <listitem>
<para> <para>
Protocol version. Currently only version <literal>1</literal> is Protocol version. Currently versions <literal>1</literal> and
supported. <literal>2</literal> are supported. The version <literal>2</literal>
is supported only for server version 14 and above, and it allows
streaming of large in-progress transactions.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -2855,7 +2857,10 @@ The commands accepted in replication mode are: ...@@ -2855,7 +2857,10 @@ The commands accepted in replication mode are:
<para> <para>
The logical replication protocol sends individual transactions one by one. The logical replication protocol sends individual transactions one by one.
This means that all messages between a pair of Begin and Commit messages This means that all messages between a pair of Begin and Commit messages
belong to the same transaction. belong to the same transaction. It also sends changes of large in-progress
transactions between a pair of Stream Start and Stream Stop messages. The
last stream of such a transaction contains Stream Commit or Stream Abort
message.
</para> </para>
<para> <para>
...@@ -6457,8 +6462,8 @@ Message ...@@ -6457,8 +6462,8 @@ Message
</term> </term>
<listitem> <listitem>
<para> <para>
Xid of the transaction. The XID is sent only when user has Xid of the transaction (only present for streamed transactions).
requested streaming of in-progress transactions. This field is available since protocol version 2.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -6646,6 +6651,17 @@ Relation ...@@ -6646,6 +6651,17 @@ Relation
Int32 Int32
</term> </term>
<listitem> <listitem>
<para>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int32
</term>
<listitem>
<para> <para>
ID of the relation. ID of the relation.
</para> </para>
...@@ -6767,6 +6783,17 @@ Type ...@@ -6767,6 +6783,17 @@ Type
Int32 Int32
</term> </term>
<listitem> <listitem>
<para>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int32
</term>
<listitem>
<para> <para>
ID of the data type. ID of the data type.
</para> </para>
...@@ -6821,6 +6848,17 @@ Insert ...@@ -6821,6 +6848,17 @@ Insert
Int32 Int32
</term> </term>
<listitem> <listitem>
<para>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int32
</term>
<listitem>
<para> <para>
ID of the relation corresponding to the ID in the relation ID of the relation corresponding to the ID in the relation
message. message.
...@@ -6877,6 +6915,17 @@ Update ...@@ -6877,6 +6915,17 @@ Update
Int32 Int32
</term> </term>
<listitem> <listitem>
<para>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int32
</term>
<listitem>
<para> <para>
ID of the relation corresponding to the ID in the relation ID of the relation corresponding to the ID in the relation
message. message.
...@@ -6980,6 +7029,17 @@ Delete ...@@ -6980,6 +7029,17 @@ Delete
Int32 Int32
</term> </term>
<listitem> <listitem>
<para>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int32
</term>
<listitem>
<para> <para>
ID of the relation corresponding to the ID in the relation ID of the relation corresponding to the ID in the relation
message. message.
...@@ -7058,6 +7118,17 @@ Truncate ...@@ -7058,6 +7118,17 @@ Truncate
Int32 Int32
</term> </term>
<listitem> <listitem>
<para>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int32
</term>
<listitem>
<para> <para>
Number of relations Number of relations
</para> </para>
...@@ -7095,6 +7166,206 @@ Truncate ...@@ -7095,6 +7166,206 @@ Truncate
<para> <para>
The following messages (Stream Start, Stream End, Stream Commit, and
Stream Abort) are available since protocol version 2.
</para>
<variablelist>
<varlistentry>
<term>
Stream Start
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
Byte1('S')
</term>
<listitem>
<para>
Identifies the message as a stream start message.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int32
</term>
<listitem>
<para>
Xid of the transaction.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int8
</term>
<listitem>
<para>
A value of 1 indicates this is the first stream segment for
this XID, 0 for any other stream segment.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Stream Stop
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
Byte1('E')
</term>
<listitem>
<para>
Identifies the message as a stream stop message.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Stream Commit
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
Byte1('c')
</term>
<listitem>
<para>
Identifies the message as a stream commit message.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int32
</term>
<listitem>
<para>
Xid of the transaction.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int8
</term>
<listitem>
<para>
Flags; currently unused (must be 0).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int64
</term>
<listitem>
<para>
The LSN of the commit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int64
</term>
<listitem>
<para>
The end LSN of the transaction.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int64
</term>
<listitem>
<para>
Commit timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Stream Abort
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
Byte1('A')
</term>
<listitem>
<para>
Identifies the message as a stream abort message.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int32
</term>
<listitem>
<para>
Xid of the transaction.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Int32
</term>
<listitem>
<para>
Xid of the subtransaction (will be same as xid of the transaction for top-level
transactions).
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
The following message parts are shared by the above messages. The following message parts are shared by the above messages.
</para> </para>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment