Re: fix "Success" error messages

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Shawn Debnath <sdn(at)amazon(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fix "Success" error messages
Date: 2019-08-26 19:40:23
Message-ID: 36d38542-63e9-b73c-09fe-bd5e32e06066@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-06-19 04:51, Michael Paquier wrote:
> On Tue, Jun 18, 2019 at 09:13:19AM -0700, Shawn Debnath wrote:
>>> case SLRU_WRITE_FAILED:
>>> ereport(ERROR,
>>> (errcode_for_file_access(),
>>> errmsg("could not access status of transaction %u", xid),
>>> - errdetail("Could not write to file \"%s\" at offset %u: %m.",
>>> - path, offset)));
>>> + errno == 0
>>> + ? errdetail("Short write to file \"%s\" at offset %u.", path, offset)
>>> + : errdetail("Could not write to file \"%s\" at offset %u: %m.",
>>> + path, offset)));
>
> There is no point to call errcode_for_file_access() if we know that
> errno is 0. Not a big deal, still.. The last time I looked at that,
> the best way I could think of would be to replace slru_errcause with a
> proper error string generated at error time. Perhaps the partial
> read/write case does not justify this extra facility. I don't know.
> At least that would be more flexible.

Here is an updated patch set that rearranges this a bit according to
your suggestions, and also fixes some similar issues in pg_checksums.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v2-0001-Better-error-messages-for-short-reads-writes-in-S.patch text/plain 2.3 KB
v2-0002-pg_checksums-Handle-read-and-write-returns-correc.patch text/plain 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-08-26 20:07:59 Re: assertion at postmaster start
Previous Message Andrew Dunstan 2019-08-26 19:08:54 Re: "ago" times on buildfarm status page