pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: When performing a base backup, check for read errors.
Date: Fri, 06 Sep 2019 13:11:57 +0000
Message-ID: <E1i6E1t-0004um-CP@gemulon.postgresql.org> (raw)

When performing a base backup, check for read errors.

The old code didn't differentiate between a read error and a
concurrent truncation. fread reports both of these by returning 0;
you have to use feof() or ferror() to distinguish between them,
which this code did not do.

It might be a better idea to use read() rather than fread() here,
so that we can display a less-generic error message, but I'm not
sure that would qualify as a back-patchable bug fix, so just do
this much for now.

Jeevan Chalke, reviewed by Jeevan Ladhe and by me.

Discussion: http://postgr.es/m/CA+TgmobG4ywMzL5oQq2a8YKp8x2p3p1LOMMcGqpS7aekT9+ETA@mail.gmail.com

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f697c6396d73c1e6d550afed84a6bd8362d9a0d4

Modified Files
--------------
src/backend/replication/basebackup.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)



view thread (7+ messages)  latest in thread

Message-ID: <E1i6E1t-0004um-CP@gemulon.postgresql.org>
Permalink:  ../E1i6E1t-0004um-CP@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1i6E1t-0004um-CP@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: When performing a base backup, check for read errors.
  In-Reply-To: <E1i6E1t-0004um-CP@gemulon.postgresql.org>
  References: <E1i6E1t-0004um-CP@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox