pgsql: When performing a base backup, check for read errors. - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: When performing a base backup, check for read errors.
Date
Msg-id E1i6E1t-0004ue-BV@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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
------
REL_12_STABLE

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

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


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pgsql: Doc: remove some long-obsolete information frominstallation.sgm
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Doc: remove some long-obsolete information from installation.sgm