Re: Inconsistent error handling in START_REPLICATION command - Mailing list pgsql-hackers

From David Steele
Subject Re: Inconsistent error handling in START_REPLICATION command
Date
Msg-id 56E2F400.2000709@pgmasters.net
Whole thread Raw
In response to Re: Inconsistent error handling in START_REPLICATION command  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
Responses Re: Inconsistent error handling in START_REPLICATION command  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 1/21/16 9:53 AM, Shulgin, Oleksandr wrote:
On Thu, Jan 21, 2016 at 3:25 PM, Robert Haas <robertmhaas@gmail.com> wrote:

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.

Hm, you're right.  Even though the server sends COPY_BOTH message before the plugin startup, an attempt by the client to actually read the data messages results in ErrorResponse handled on the client, then the client can re-submit the corrected START_REPLICATION command and continue without the need to reconnect.  This cannot be actually tested in psql, but I can verify the behavior with my python scripts.

Then I don't have a preference for the early error reporting in this case.  If the current behavior potentially allows for more flexible error reporting, I'm for keeping it.

It looks like a decision needs to be made here whether to apply this patch, send it back to the author, or reject it so I'm marking it "Ready for Committer".

Robert, since you were participating in this conversation can you have a look?

-- 
-David
david@pgmasters.net
Attachment

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: auto_explain sample rate
Next
From: Jesper Pedersen
Date:
Subject: Re: Speedup twophase transactions