Re: Misleading panic message in backend/access/transam/xlog.c - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Misleading panic message in backend/access/transam/xlog.c
Date
Msg-id CA+TgmobAaLT+C_+4HsACAceGC4nT=o4HD2QLoUo1Rj9fUDhatA@mail.gmail.com
Whole thread Raw
In response to Re: Misleading panic message in backend/access/transam/xlog.c  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Wed, Jan 9, 2019 at 8:38 PM Michael Paquier <michael@paquier.xyz> wrote:
> On Wed, Jan 09, 2019 at 05:09:19PM -0800, Andres Freund wrote:
> > IIRC we have other such errors including offset and length (and if
> > not we'll grow some). It should be formatted as a genetic write
> > error with the file name, no reference to log file, etc, even if
> > there's no precedent.
>
> Yeah, there are a couple of them:
> access/transam/xlog.c:
> errmsg("could not read from log segment %s, offset %u: %m",

In smgr.c, we have:

"could not read block %u in file \"%s\": %m"

That seems to be the closet thing we have to a generic message
template right now, but it's not entirely generic because it talks
about blocks.  Maybe we should go with something like:

"could not read %u bytes in file \"%s\" at offset %u: %m"

...and use that for both WAL and smgr.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Early WIP/PoC for inlining CTEs
Next
From: Robert Haas
Date:
Subject: Re: add_partial_path() may remove dominated path but still in use