Re: BM_IO_ERROR flag is lost in TerminateBufferIO due to order of operations in UnlockBufHdrExt

From: Andres Freund <andres(at)anarazel(dot)de>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: BM_IO_ERROR flag is lost in TerminateBufferIO due to order of operations in UnlockBufHdrExt
Date: 2026-07-10 17:33:11
Message-ID: hm4wqcu3zvl76go6zvyvr77tzgbiehs5v4lvaa53uwlj5wqar7@nfohqqm3r3i3
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2026-06-15 12:18:43 -0400, Andres Freund wrote:
> On 2026-06-02 23:21:49 -0400, Andres Freund wrote:
> > On 2026-06-02 12:15:40 -0400, Melanie Plageman wrote:
> > > On Mon, Apr 6, 2026 at 4:21 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> > > >
> > > > On Mon, Mar 30, 2026 at 11:25:55AM +0300, Yura Sokolov wrote:
> > > > > Have you any recommendations for patch?
> > > > >
> > > > > Should I create CF item for patch?
> > > >
> > > > The business with unset_flag_bits is new as of HEAD, so this could
> > > > qualify as an open item, to be tracked here:
> > > > https://wiki.postgresql.org/wiki/PostgreSQL_19_Open_Items
> > >
> > > There hasn't been recent activity on this thread and it is one of the
> > > oldest open items. Even if we don't have time to review the test right
> > > now, it is probably worth pushing the fix. Though we have just missed
> > > beta1...
> >
> > Ugh. I had lost track of this. I'll get back to it as soon as I have squared
> > the CI stuff away.
>
> I'd hoped to push a patch by now, but unfortunately didn't yet, and I'm about
> to take 4 days off outside of reception. So pushing it now seems unwise.
>
> FWIW, I am inclined to just fix UnlockBufHdrExt() to first subtract and then
> add the bits, rather than the other way round and document that fact. I think
> that's cleaner than having to force callers to do their own bit math to
> prevent bits from overlapping.
>
> I played around a bunch with the tests, but I suspect it's better to wait with
> testing this path until the write path is converted to AIO, otherwise we have
> to introduce infrastructure that we'll just rip out again...

Pushed that way, and marked the open item as resolved. I want to introduce
some more tests around this, but I think that's 20 material.

Thanks again for the report!

Greetings,

Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2026-07-10 17:34:03 Re: Do not lock tables in get_tables_to_repack
Previous Message Andres Freund 2026-07-10 17:32:08 Re: s/pg_attribute_always_inline/pg_always_inline/?