Replication protocol doc fix - Mailing list pgsql-hackers

From Jeff Davis
Subject Replication protocol doc fix
Date
Msg-id c71317d9a1f486de00943cebc3ad1b27cf28d075.camel@j-davis.com
Whole thread Raw
Responses Re: Replication protocol doc fix
List 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





pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Testing autovacuum wraparound (including failsafe)
Next
From: "osumi.takamichi@fujitsu.com"
Date:
Subject: RE: locking [user] catalog tables vs 2pc vs logical rep