Re: Buffer locking is special (hints, checksums, AIO writes) - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Buffer locking is special (hints, checksums, AIO writes)
Date
Msg-id aYtg622xasbSju7_@alap3.anarazel.de
Whole thread Raw
In response to Re: Buffer locking is special (hints, checksums, AIO writes)  (Antonin Houska <ah@cybertec.at>)
Responses Re: Buffer locking is special (hints, checksums, AIO writes)
List pgsql-hackers
Hi,

On 2026-02-10 08:46:27 +0100, Antonin Houska wrote:
> Andres Freund <andres@anarazel.de> wrote:
> > I think we ought to instead restrict the page-at-a-time scans to only happen
> > with "real" mvcc snapshots. I.e. this:
> > 
> >     /*
> >      * Disable page-at-a-time mode if it's not a MVCC-safe snapshot.
> >      */
> >     if (!(snapshot && IsMVCCSnapshot(snapshot)))
> >         scan->rs_base.rs_flags &= ~SO_ALLOW_PAGEMODE;
> >
> > should trigger for historic snapshots as well.
> 
> I suppose you mean changing it to
> 
>     if (!(snapshot && IsMVCCSnapshot(snapshot) &&
>           !IsHistoricMVCCSnapshot(snapshot)))
>         scan->rs_base.rs_flags &= ~SO_ALLOW_PAGEMODE;

Yes.

For something committable, I think we should probably split IsMVCCSnapshot
into IsMVCCSnapshot(), just accepting SNAPSHOT_MVCC, and IsMVCCLikeSnapshot()
accepting both SNAPSHOT_MVCC and SNAPSHOT_HISTORIC_MVCC. And then go through
all the existing callers of IsMVCCSnapshot() - only about half should stay
as-is, I think.


> > Does that fix the issue for you?
> 
> Yes, with this change, I don't hit the problem anymore.

Great!

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Subquery pull-up increases jointree search space
Next
From: Tom Lane
Date:
Subject: Instability in postgres_fdw regression tests