Replication protocol doc fix

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Replication protocol doc fix
Date: 2021-06-11 01:26:56
Message-ID: c71317d9a1f486de00943cebc3ad1b27cf28d075.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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. So the actual behavior seems to be more like a "COPY
FROM STDIN" initiated with the simple query protocol:

"In the event of a backend-detected error during copy-in mode
(including receipt of a CopyFail message), the backend will issue an
ErrorResponse message. ... If the COPY command was issued in a simple
Query message, the rest of that message is discarded and ReadyForQuery
is issued ... any subsequent CopyData, CopyDone, or CopyFail messages
issued by the frontend will simply be dropped."

If the client does send a Sync, it results in an extra ReadyForQuery
message.

Diagnosed and reported by Petros Angelatos (petrosagg on Github).

Regards,
Jeff Davis

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message osumi.takamichi@fujitsu.com 2021-06-11 01:27:40 RE: locking [user] catalog tables vs 2pc vs logical rep
Previous Message Andres Freund 2021-06-11 01:18:50 Re: Testing autovacuum wraparound (including failsafe)