]> granicus.if.org Git - postgresql/commit
Again report a useful error message when walreceiver's connection closes.
authorAndres Freund <andres@anarazel.de>
Thu, 8 Jun 2017 21:42:18 +0000 (14:42 -0700)
committerAndres Freund <andres@anarazel.de>
Thu, 8 Jun 2017 21:51:43 +0000 (14:51 -0700)
commit5fd56b9f5b4a007a4122c313a184f78f1647c4ab
treeb5026e1e241c7658a395f06bad44808898458979
parent5c4109f2c8c2027114cfdc7c0617f81928a0b10e
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: -
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c