Hi,

On 2026-02-10 08:46:27 +0100, Antonin Houska wrote:
> Andres Freund <[email protected]> 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


Reply via email to