aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2020-10-14 20:12:26 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2020-10-14 20:12:26 -0300
commit4e9821b6fac5042e872d5397f711a67984b165f8 (patch)
tree805886d73e19331696339de5aa94e6cdefc3808b /doc/src
parentb94109ce375b137f235149bfba3559c69f4573e7 (diff)
downloadpostgresql-4e9821b6fac5042e872d5397f711a67984b165f8.tar.gz
postgresql-4e9821b6fac5042e872d5397f711a67984b165f8.zip
Restore replication protocol's duplicate command tags
I removed the duplicate command tags for START_REPLICATION inadvertently in commit 07082b08cc5d, but the replication protocol requires them. The fact that the replication protocol was broken was not noticed because all our test cases use an optimized code path that exits early, failing to verify that the behavior is correct for non-optimized cases. Put them back. Also document this protocol quirk. Add a test case that shows the failure. It might still succeed even without the patch when run on a fast enough server, but it suffices to show the bug in enough cases that it would be noticed in buildfarm. Author: Álvaro Herrera <alvherre@alvh.no-ip.org> Reported-by: Henry Hinze <henry.hinze@gmail.com> Reviewed-by: Petr Jelínek <petr.jelinek@2ndquadrant.com> Discussion: https://postgr.es/m/16643-eaadeb2a1a58d28c@postgresql.org
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/protocol.sgml8
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index f5e33181061..5e06c7523d8 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2059,8 +2059,9 @@ The commands accepted in replication mode are:
the switch position is the end of the WAL that was streamed, but there
are corner cases where the server can send some WAL from the old
timeline that it has not itself replayed before promoting. Finally, the
- server sends CommandComplete message, and is ready to accept a new
- command.
+ server sends two CommandComplete messages (one that ends the CopyData
+ and the other ends the <literal>START_REPLICATION</literal> itself), and
+ is ready to accept a new command.
</para>
<para>
@@ -2382,7 +2383,8 @@ The commands accepted in replication mode are:
<para>
The messages inside the CopyBothResponse messages are of the same format
- documented for <literal>START_REPLICATION ... PHYSICAL</literal>.
+ documented for <literal>START_REPLICATION ... PHYSICAL</literal>, including
+ two CommandComplete messages.
</para>
<para>