Re: Replication protocol doc fix - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Replication protocol doc fix
Date
Msg-id CA+Tgmob9xCcs1w0TAtoHDLaHu9Ca1WZErHE_z5PM46b7S5SAbw@mail.gmail.com
Whole thread Raw
In response to Replication protocol doc fix  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Replication protocol doc fix
List pgsql-hackers
On Thu, Jun 10, 2021 at 9:26 PM Jeff Davis <pgsql@j-davis.com> wrote:
> The docs currently say (introduced in commit 91fa853):
>
> "In the event of a backend-detected error during copy-both mode, the
> backend will issue an ErrorResponse message, discard frontend messages
> until a Sync message is received, and then issue ReadyForQuery and
> return to normal processing."
>
> But that doesn't seem to be correct: Sync is only used for the extended
> query protocol, and CopyBoth can only be initiated with the simple
> query protocol.

My impression was that CopyBoth can be initiated either way, but if
you use the extended query protocol, then the result is a hopeless
mess, because the protocol is badly designed:

https://www.postgresql.org/message-id/CA+Tgmoa4eA+cPXaiGQmEBp9XisVd3ZE9dbvnbZEvx9UcMiw2tg@mail.gmail.com

But I think you're correct in saying that the discard-until-Sync
behavior only happens if the extended query protocol is used, so I
agree that the current text is wrong.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Question about StartLogicalReplication() error path
Next
From: Tomas Vondra
Date:
Subject: Re: postgres_fdw batching vs. (re)creating the tuple slots