Re: Inconsistent error handling in START_REPLICATION command

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Inconsistent error handling in START_REPLICATION command
Дата
Msg-id CA+TgmoZHAiYO5EHCw0pEHD_wgp3wnp9tnYoM+StWUtM4dpXwVg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Inconsistent error handling in START_REPLICATION command  (Craig Ringer <craig@2ndquadrant.com>)
Ответы Re: Inconsistent error handling in START_REPLICATION command  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
Список pgsql-hackers
On Wed, Jan 20, 2016 at 2:28 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
> It enters COPY BOTH mode before it invokes the startup callback. The client
> has no way to unilaterally terminate COPY BOTH mode and return to the normal
> walsender protocol. The server doesn't do it when there's an ERROR. So the
> only option the client has for recovery is to disconnect and reconnect.

This isn't my understanding of how the protocol works, and it's not
what the documentation says either.

Per http://www.postgresql.org/docs/current/static/protocol-flow.html:

===
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. The frontend should treat receipt of
ErrorResponse as terminating the copy in both directions; no CopyDone
should be sent in this case.
===

So it's true that the client can't unilaterally terminate COPY BOTH
mode; it can only send CopyDone.  But an error on the server side
should do so.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Anastasia Lubennikova
Дата:
Сообщение: Re: Patch: fix lock contention for HASHHDR.mutex
Следующее
От: "Shulgin, Oleksandr"
Дата:
Сообщение: Re: Inconsistent error handling in START_REPLICATION command