From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add proper errcodes to new error messages for read() failures
Date: Mon, 23 Jul 2018 00:38:32 +0000
Message-ID: <E1fhOrw-0005cg-4e@gemulon.postgresql.org> (raw)
Add proper errcodes to new error messages for read() failures
Those would use the default ERRCODE_INTERNAL_ERROR, but for foreseeable
failures an errcode ought to be set, ERRCODE_DATA_CORRUPTED making the
most sense here.
While on the way, fix one errcode_for_file_access missing in origin.c
since the code has been created, and remove one assignment of errno to 0
before calling read(), as this was around to fit with what was present
before 811b6e36 where errno would not be set when not enough bytes are
read. I have noticed the first one, and Tom has pinged me about the
second one.
Author: Michael Paquier
Reported-by: Tom Lane
Discussion: https://postgr.es/m/27265.1531925836@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/e41d0a1090b75fed4c033c2e404643382348f88e
Modified Files
--------------
src/backend/access/transam/xlog.c | 10 ++++++----
src/backend/replication/logical/origin.c | 6 ++++--
src/backend/replication/logical/snapbuild.c | 12 ++++++++----
src/backend/replication/slot.c | 6 ++++--
src/backend/replication/walsender.c | 6 ++++--
src/backend/utils/cache/relmapper.c | 3 ++-
src/common/controldata_utils.c | 3 ++-
7 files changed, 30 insertions(+), 16 deletions(-)
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: michael@paquier.xyz
Subject: Re: pgsql: Add proper errcodes to new error messages for read() failures
In-Reply-To: <E1fhOrw-0005cg-4e@gemulon.postgresql.org>
References: <E1fhOrw-0005cg-4e@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