Confused about stream replication protocol documentation

Started by Li Japinabout 5 years ago6 messages
#1Li Japin
japinli@hotmail.com

Hi, all

In Stream Replication Protocol [1]https://www.postgresql.org/docs/devel/protocol-replication.html, the documentation of `START_REPLICATION` message is

XLogData (B)

Primary keepalive message (B)

Standby status update (F)

Hot Standby feedback message (F)
...

I’m confused about the means of ‘B’ and ‘F’? If it doesn't make sense, why we document here?
However, if it makes sense, should we explain it?
Can someone help me out?

Anyway, thanks in advance!

[1]: https://www.postgresql.org/docs/devel/protocol-replication.html

--
Best regards
Japin Li

#2Fujii Masao
masao.fujii@oss.nttdata.com
In reply to: Li Japin (#1)
Re: Confused about stream replication protocol documentation

On 2020/12/22 18:07, Li Japin wrote:

Hi, all

In Stream Replication Protocol [1], the documentation of `START_REPLICATION` message is

XLogData (B)
  …
Primary keepalive message (B)
  …
Standby status update (F)
  …
Hot Standby feedback message (F)
  ...

I’m confused about the means of ‘B’ and ‘F’? If it doesn't make sense, why we document here?
However, if it makes sense, should we explain it?
Can someone help me out?

‘B’ means a backend and ‘F’ means a frontend. Maybe as [1]https://www.postgresql.org/docs/devel/protocol-message-formats.html does, we should
add the note like "Each is marked to indicate that it can be sent by
a frontend (F) and a backend (B)" into the description about each message
format for START_REPLICATION.

[1]: https://www.postgresql.org/docs/devel/protocol-message-formats.html
https://www.postgresql.org/docs/devel/protocol-message-formats.html

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

#3Li Japin
japinli@hotmail.com
In reply to: Fujii Masao (#2)
Re: Confused about stream replication protocol documentation

On Dec 22, 2020, at 11:13 PM, Fujii Masao <masao.fujii@oss.nttdata.com<mailto:masao.fujii@oss.nttdata.com>> wrote:

‘B’ means a backend and ‘F’ means a frontend. Maybe as [1]https://www.postgresql.org/docs/devel/protocol-message-formats.html does, we should
add the note like "Each is marked to indicate that it can be sent by
a frontend (F) and a backend (B)" into the description about each message
format for START_REPLICATION.

[1]: https://www.postgresql.org/docs/devel/protocol-message-formats.html
https://www.postgresql.org/docs/devel/protocol-message-formats.html

Thanks for your clarify. Maybe we should move the "protocol message formats”
before “stream replication protocol” or referenced it in "stream replication protocol”.

--
Best regards
Japin Li

#4Fujii Masao
masao.fujii@oss.nttdata.com
In reply to: Li Japin (#3)
Re: Confused about stream replication protocol documentation

On 2020/12/23 11:08, Li Japin wrote:

On Dec 22, 2020, at 11:13 PM, Fujii Masao <masao.fujii@oss.nttdata.com <mailto:masao.fujii@oss.nttdata.com>> wrote:

‘B’ means a backend and ‘F’ means a frontend. Maybe as [1] does, we should
add the note like "Each is marked to indicate that it can be sent by
a frontend (F) and a backend (B)" into the description about each message
format for START_REPLICATION.

[1]
https://www.postgresql.org/docs/devel/protocol-message-formats.html <https://www.postgresql.org/docs/devel/protocol-message-formats.html&gt;

Thanks for your clarify.  Maybe we should move the "protocol message formats”
before “stream replication protocol” or referenced it in "stream replication protocol”.

I like the latter. And maybe it's better to reference to also
"53.6. Message Data Types" there because the messages for
START_REPLICATION use the message data types.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

#5Li Japin
japinli@hotmail.com
In reply to: Fujii Masao (#4)
1 attachment(s)
Re: Confused about stream replication protocol documentation

On Dec 23, 2020, at 8:11 PM, Fujii Masao <masao.fujii@oss.nttdata.com<mailto:masao.fujii@oss.nttdata.com>> wrote:

On 2020/12/23 11:08, Li Japin wrote:
On Dec 22, 2020, at 11:13 PM, Fujii Masao <masao.fujii@oss.nttdata.com<mailto:masao.fujii@oss.nttdata.com> <mailto:masao.fujii@oss.nttdata.com>> wrote:

‘B’ means a backend and ‘F’ means a frontend. Maybe as [1]https://www.postgresql.org/docs/devel/protocol-message-formats.html <https://www.postgresql.org/docs/devel/protocol-message-formats.html&gt; Thanks for your clarify. Maybe we should move the "protocol message formats” before “stream replication protocol” or referenced it in "stream replication protocol”. does, we should
add the note like "Each is marked to indicate that it can be sent by
a frontend (F) and a backend (B)" into the description about each message
format for START_REPLICATION.

[1]: https://www.postgresql.org/docs/devel/protocol-message-formats.html <https://www.postgresql.org/docs/devel/protocol-message-formats.html&gt; Thanks for your clarify. Maybe we should move the "protocol message formats” before “stream replication protocol” or referenced it in "stream replication protocol”.
https://www.postgresql.org/docs/devel/protocol-message-formats.html <https://www.postgresql.org/docs/devel/protocol-message-formats.html&gt;
Thanks for your clarify. Maybe we should move the "protocol message formats”
before “stream replication protocol” or referenced it in "stream replication protocol”.

I like the latter. And maybe it's better to reference to also
"53.6. Message Data Types" there because the messages for
START_REPLICATION use the message data types.

Add reference about “protocol message types” and “protocol message formats”.

index 4899bacda7..5793936b42 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2069,8 +2069,9 @@ The commands accepted in replication mode are:
      </para>
      <para>
-      WAL data is sent as a series of CopyData messages.  (This allows
-      other information to be intermixed; in particular the server can send
+      WAL data is sent as a series of CopyData messages
+      (See <xref linkend="protocol-message-types"/> and <xref linkend="protocol-message-formats"/>).
+      (This allows other information to be intermixed; in particular the server can send
       an ErrorResponse message if it encounters a failure after beginning
       to stream.)  The payload of each CopyData message from server to the
       client contains a message of one of the following formats:

--
Best regards
Japin Li

Attachments:

stream-replication-protocol-documentation.patchapplication/octet-stream; name=stream-replication-protocol-documentation.patchDownload
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 4899bacda7..5793936b42 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2069,8 +2069,9 @@ The commands accepted in replication mode are:
      </para>
 
      <para>
-      WAL data is sent as a series of CopyData messages.  (This allows
-      other information to be intermixed; in particular the server can send
+      WAL data is sent as a series of CopyData messages
+      (See <xref linkend="protocol-message-types"/> and <xref linkend="protocol-message-formats"/>).
+      (This allows other information to be intermixed; in particular the server can send
       an ErrorResponse message if it encounters a failure after beginning
       to stream.)  The payload of each CopyData message from server to the
       client contains a message of one of the following formats:
#6Bruce Momjian
bruce@momjian.us
In reply to: Li Japin (#5)
Re: Confused about stream replication protocol documentation

Patch applied to master, thanks.

---------------------------------------------------------------------------

On Thu, Dec 24, 2020 at 02:28:53AM +0000, Li Japin wrote:

On Dec 23, 2020, at 8:11 PM, Fujii Masao <masao.fujii@oss.nttdata.com>
wrote:

On 2020/12/23 11:08, Li Japin wrote:

On Dec 22, 2020, at 11:13 PM, Fujii Masao <
masao.fujii@oss.nttdata.com <mailto:masao.fujii@oss.nttdata.com>>
wrote:

‘B’ means a backend and ‘F’ means a frontend. Maybe as [1] does, we
should
add the note like "Each is marked to indicate that it can be sent
by
a frontend (F) and a backend (B)" into the description about each
message
format for START_REPLICATION.

[1]
https://www.postgresql.org/docs/devel/protocol-message-formats.html
<https://www.postgresql.org/docs/devel/
protocol-message-formats.html>

Thanks for your clarify. Maybe we should move the "protocol message
formats”
before “stream replication protocol” or referenced it in "stream
replication protocol”.

I like the latter. And maybe it's better to reference to also
"53.6. Message Data Types" there because the messages for
START_REPLICATION use the message data types.

Add reference about “protocol message types” and “protocol message formats”.

index 4899bacda7..5793936b42 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2069,8 +2069,9 @@ The commands accepted in replication mode are:
</para>
<para>
-      WAL data is sent as a series of CopyData messages.  (This allows
-      other information to be intermixed; in particular the server can send
+      WAL data is sent as a series of CopyData messages
+      (See <xref linkend="protocol-message-types"/> and <xref linkend=
"protocol-message-formats"/>).
+      (This allows other information to be intermixed; in particular the
server can send
an ErrorResponse message if it encounters a failure after beginning
to stream.)  The payload of each CopyData message from server to the
client contains a message of one of the following formats:

--
Best regards
Japin Li

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 4899bacda7..5793936b42 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2069,8 +2069,9 @@ The commands accepted in replication mode are:
</para>
<para>
-      WAL data is sent as a series of CopyData messages.  (This allows
-      other information to be intermixed; in particular the server can send
+      WAL data is sent as a series of CopyData messages
+      (See <xref linkend="protocol-message-types"/> and <xref linkend="protocol-message-formats"/>).
+      (This allows other information to be intermixed; in particular the server can send
an ErrorResponse message if it encounters a failure after beginning
to stream.)  The payload of each CopyData message from server to the
client contains a message of one of the following formats:

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.