Skip to content

Commit 15c1a9d

Browse files
author
Amit Kapila
committed
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
1 parent 7a39725 commit 15c1a9d

File tree

1 file changed

+277
-6
lines changed

1 file changed

+277
-6
lines changed

doc/src/sgml/protocol.sgml

+277-6
Original file line numberDiff line numberDiff line change
@@ -2797,9 +2797,11 @@ The commands accepted in replication mode are:
27972797
</term>
27982798
<listitem>
27992799
<para>
2800-
Protocol version. Currently only version <literal>1</literal> is
2801-
supported.
2802-
</para>
2800+
Protocol version. Currently versions <literal>1</literal> and
2801+
<literal>2</literal> are supported. The version <literal>2</literal>
2802+
is supported only for server version 14 and above, and it allows
2803+
streaming of large in-progress transactions.
2804+
</para>
28032805
</listitem>
28042806
</varlistentry>
28052807

@@ -2855,7 +2857,10 @@ The commands accepted in replication mode are:
28552857
<para>
28562858
The logical replication protocol sends individual transactions one by one.
28572859
This means that all messages between a pair of Begin and Commit messages
2858-
belong to the same transaction.
2860+
belong to the same transaction. It also sends changes of large in-progress
2861+
transactions between a pair of Stream Start and Stream Stop messages. The
2862+
last stream of such a transaction contains Stream Commit or Stream Abort
2863+
message.
28592864
</para>
28602865

28612866
<para>
@@ -6457,8 +6462,8 @@ Message
64576462
</term>
64586463
<listitem>
64596464
<para>
6460-
Xid of the transaction. The XID is sent only when user has
6461-
requested streaming of in-progress transactions.
6465+
Xid of the transaction (only present for streamed transactions).
6466+
This field is available since protocol version 2.
64626467
</para>
64636468
</listitem>
64646469
</varlistentry>
@@ -6646,6 +6651,17 @@ Relation
66466651
Int32
66476652
</term>
66486653
<listitem>
6654+
<para>
6655+
Xid of the transaction (only present for streamed transactions).
6656+
This field is available since protocol version 2.
6657+
</para>
6658+
</listitem>
6659+
</varlistentry>
6660+
<varlistentry>
6661+
<term>
6662+
Int32
6663+
</term>
6664+
<listitem>
66496665
<para>
66506666
ID of the relation.
66516667
</para>
@@ -6767,6 +6783,17 @@ Type
67676783
Int32
67686784
</term>
67696785
<listitem>
6786+
<para>
6787+
Xid of the transaction (only present for streamed transactions).
6788+
This field is available since protocol version 2.
6789+
</para>
6790+
</listitem>
6791+
</varlistentry>
6792+
<varlistentry>
6793+
<term>
6794+
Int32
6795+
</term>
6796+
<listitem>
67706797
<para>
67716798
ID of the data type.
67726799
</para>
@@ -6821,6 +6848,17 @@ Insert
68216848
Int32
68226849
</term>
68236850
<listitem>
6851+
<para>
6852+
Xid of the transaction (only present for streamed transactions).
6853+
This field is available since protocol version 2.
6854+
</para>
6855+
</listitem>
6856+
</varlistentry>
6857+
<varlistentry>
6858+
<term>
6859+
Int32
6860+
</term>
6861+
<listitem>
68246862
<para>
68256863
ID of the relation corresponding to the ID in the relation
68266864
message.
@@ -6877,6 +6915,17 @@ Update
68776915
Int32
68786916
</term>
68796917
<listitem>
6918+
<para>
6919+
Xid of the transaction (only present for streamed transactions).
6920+
This field is available since protocol version 2.
6921+
</para>
6922+
</listitem>
6923+
</varlistentry>
6924+
<varlistentry>
6925+
<term>
6926+
Int32
6927+
</term>
6928+
<listitem>
68806929
<para>
68816930
ID of the relation corresponding to the ID in the relation
68826931
message.
@@ -6980,6 +7029,17 @@ Delete
69807029
Int32
69817030
</term>
69827031
<listitem>
7032+
<para>
7033+
Xid of the transaction (only present for streamed transactions).
7034+
This field is available since protocol version 2.
7035+
</para>
7036+
</listitem>
7037+
</varlistentry>
7038+
<varlistentry>
7039+
<term>
7040+
Int32
7041+
</term>
7042+
<listitem>
69837043
<para>
69847044
ID of the relation corresponding to the ID in the relation
69857045
message.
@@ -7058,6 +7118,17 @@ Truncate
70587118
Int32
70597119
</term>
70607120
<listitem>
7121+
<para>
7122+
Xid of the transaction (only present for streamed transactions).
7123+
This field is available since protocol version 2.
7124+
</para>
7125+
</listitem>
7126+
</varlistentry>
7127+
<varlistentry>
7128+
<term>
7129+
Int32
7130+
</term>
7131+
<listitem>
70617132
<para>
70627133
Number of relations
70637134
</para>
@@ -7095,6 +7166,206 @@ Truncate
70957166

70967167
<para>
70977168

7169+
The following messages (Stream Start, Stream End, Stream Commit, and
7170+
Stream Abort) are available since protocol version 2.
7171+
7172+
</para>
7173+
7174+
<variablelist>
7175+
7176+
<varlistentry>
7177+
<term>
7178+
Stream Start
7179+
</term>
7180+
<listitem>
7181+
<para>
7182+
7183+
<variablelist>
7184+
<varlistentry>
7185+
<term>
7186+
Byte1('S')
7187+
</term>
7188+
<listitem>
7189+
<para>
7190+
Identifies the message as a stream start message.
7191+
</para>
7192+
</listitem>
7193+
</varlistentry>
7194+
<varlistentry>
7195+
<term>
7196+
Int32
7197+
</term>
7198+
<listitem>
7199+
<para>
7200+
Xid of the transaction.
7201+
</para>
7202+
</listitem>
7203+
</varlistentry>
7204+
<varlistentry>
7205+
<term>
7206+
Int8
7207+
</term>
7208+
<listitem>
7209+
<para>
7210+
A value of 1 indicates this is the first stream segment for
7211+
this XID, 0 for any other stream segment.
7212+
</para>
7213+
</listitem>
7214+
</varlistentry>
7215+
7216+
</variablelist>
7217+
</para>
7218+
</listitem>
7219+
</varlistentry>
7220+
7221+
<varlistentry>
7222+
<term>
7223+
Stream Stop
7224+
</term>
7225+
<listitem>
7226+
<para>
7227+
7228+
<variablelist>
7229+
<varlistentry>
7230+
<term>
7231+
Byte1('E')
7232+
</term>
7233+
<listitem>
7234+
<para>
7235+
Identifies the message as a stream stop message.
7236+
</para>
7237+
</listitem>
7238+
</varlistentry>
7239+
7240+
</variablelist>
7241+
</para>
7242+
</listitem>
7243+
</varlistentry>
7244+
7245+
<varlistentry>
7246+
<term>
7247+
Stream Commit
7248+
</term>
7249+
<listitem>
7250+
<para>
7251+
7252+
<variablelist>
7253+
<varlistentry>
7254+
<term>
7255+
Byte1('c')
7256+
</term>
7257+
<listitem>
7258+
<para>
7259+
Identifies the message as a stream commit message.
7260+
</para>
7261+
</listitem>
7262+
</varlistentry>
7263+
<varlistentry>
7264+
<term>
7265+
Int32
7266+
</term>
7267+
<listitem>
7268+
<para>
7269+
Xid of the transaction.
7270+
</para>
7271+
</listitem>
7272+
</varlistentry>
7273+
<varlistentry>
7274+
<term>
7275+
Int8
7276+
</term>
7277+
<listitem>
7278+
<para>
7279+
Flags; currently unused (must be 0).
7280+
</para>
7281+
</listitem>
7282+
</varlistentry>
7283+
<varlistentry>
7284+
<term>
7285+
Int64
7286+
</term>
7287+
<listitem>
7288+
<para>
7289+
The LSN of the commit.
7290+
</para>
7291+
</listitem>
7292+
</varlistentry>
7293+
<varlistentry>
7294+
<term>
7295+
Int64
7296+
</term>
7297+
<listitem>
7298+
<para>
7299+
The end LSN of the transaction.
7300+
</para>
7301+
</listitem>
7302+
</varlistentry>
7303+
<varlistentry>
7304+
<term>
7305+
Int64
7306+
</term>
7307+
<listitem>
7308+
<para>
7309+
Commit timestamp of the transaction. The value is in number
7310+
of microseconds since PostgreSQL epoch (2000-01-01).
7311+
</para>
7312+
</listitem>
7313+
</varlistentry>
7314+
7315+
</variablelist>
7316+
</para>
7317+
</listitem>
7318+
</varlistentry>
7319+
7320+
<varlistentry>
7321+
<term>
7322+
Stream Abort
7323+
</term>
7324+
<listitem>
7325+
<para>
7326+
7327+
<variablelist>
7328+
<varlistentry>
7329+
<term>
7330+
Byte1('A')
7331+
</term>
7332+
<listitem>
7333+
<para>
7334+
Identifies the message as a stream abort message.
7335+
</para>
7336+
</listitem>
7337+
</varlistentry>
7338+
<varlistentry>
7339+
<term>
7340+
Int32
7341+
</term>
7342+
<listitem>
7343+
<para>
7344+
Xid of the transaction.
7345+
</para>
7346+
</listitem>
7347+
</varlistentry>
7348+
<varlistentry>
7349+
<term>
7350+
Int32
7351+
</term>
7352+
<listitem>
7353+
<para>
7354+
Xid of the subtransaction (will be same as xid of the transaction for top-level
7355+
transactions).
7356+
</para>
7357+
</listitem>
7358+
</varlistentry>
7359+
7360+
</variablelist>
7361+
</para>
7362+
</listitem>
7363+
</varlistentry>
7364+
7365+
</variablelist>
7366+
7367+
<para>
7368+
70987369
The following message parts are shared by the above messages.
70997370

71007371
</para>

0 commit comments

Comments
 (0)