Re: Odd usage of errmsg_internal in bufmgr.c

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Odd usage of errmsg_internal in bufmgr.c
Date: 2026-02-12 18:34:49
Message-ID: CAN4CZFPugfT_HRsvO1-BbA6RYHuUPgJwR7BGdF8ECjgLsj=01g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Perhaps gratuitously so ... For instance, AFAICS the first block could
> be:

I also tried to play with a few variants for this, and I reached the
same conclusion: the cleanest version is when we simply repeat the
messages.
If we unify the messages a bit (the zeroing singular form is a bit
different compared to the others), we could introduce a helper
function but it doesn't seem that readable to me.

Also:

if (result.status == PGAIO_RS_ERROR)
{
Assert(!zeroed_any); /* can't have invalid pages when zeroing them */
- affected_count = zeroed_or_error_count;
- msg_one = _("invalid page in block %u of relation \"%s\"");

* The comment after assert seems wrong, isn't it backwards? Can't have
zeroed pages with failed reads
* Is it really okay to classify read errors as "invalid pages"? This
is a read failure, so I imagine this can happen if we lost a disk
because of faulty/flaky hardware, or a user unmounting a partition, or
moving the file, or anything like that, so we weren't able to actually
try to read it. Shouldn't the error say something about read failure
or unreadable pages instead?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zsolt Parragi 2026-02-12 18:51:33 Re: Improve OAuth discovery logging
Previous Message Alexandre Felipe 2026-02-12 18:08:26 Re: Incremental View Maintenance, take 2