Re: Odd usage of errmsg_internal in bufmgr.c

From: Andres Freund <andres(at)anarazel(dot)de>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: Álvaro Herrera <alvherre(at)kurilemu(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 19:17:34
Message-ID: aY4mK1OryYNBt5J9@alap3.anarazel.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2026-02-12 18:34:49 +0000, Zsolt Parragi wrote:
> 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

No, I don't think so. This is just about errors on the bufmgr layer. If
zero_damaged_pages is on, all errors on the bufmgr layer are handled by
zeroing the page.

> * 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.

As mentioned above, this is just about errors on the bufmgr layer. If you have
the entire IO fail, it'll be reported via md.c:md_readv_report(). That case is
simpler, since you can't have a case where parts of the IO had an IO error,
but others worked ok.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yasir 2026-02-12 19:18:39 Re: Regression failures after changing PostgreSQL blocksize
Previous Message Álvaro Herrera 2026-02-12 19:16:52 Re: Odd usage of errmsg_internal in bufmgr.c