pgsql: Again report a useful error message when walreceiver's connectio

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Again report a useful error message when walreceiver's connectio
Date: 2017-06-08 21:57:18
Message-ID: E1dJ5Qc-0005zZ-5N@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Again report a useful error message when walreceiver's connection closes.

Since 7c4f52409a8c (merged in v10), a shutdown master is reported as
FATAL: unexpected result after CommandComplete: server closed the connection unexpectedly
by walsender. It used to be
LOG: replication terminated by primary server
FATAL: could not send end-of-streaming message to primary: no COPY in progress
while the old message clearly is not perfect, it's definitely better
than what's reported now.

The change comes from the attempt to handle finished COPYs without
erroring out, needed for the new logical replication, which wasn't
needed before.

There's probably better ways to handle this, but for now just
explicitly check for a closed connection.

Author: Petr Jelinek
Reviewed-By: Andres Freund
Discussion: https://postgr.es/m/f7c7dd08-855c-e4ed-41f4-d064a6c0665a@2ndquadrant.com
Backpatch: -

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5fd56b9f5b4a007a4122c313a184f78f1647c4ab

Modified Files
--------------
.../replication/libpqwalreceiver/libpqwalreceiver.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-06-08 22:46:12 pgsql: Use standard interrupt handling in logical replication launcher.
Previous Message Peter Eisentraut 2017-06-08 21:20:14 pgsql: Update key words table for version 10