Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Peter Geoghegan <pg(at)bowt(dot)ie>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic
Date: 2021-06-10 15:20:47
Message-ID: CAEze2WgHq8QBBF=_AT5WrR5Mprs5gnv3n96gLFO6y15fPC_xMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 9 Jun 2021 at 20:45, Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> Specifically, the issue is that it uses the innocuous looking
>
> else if (RelationIsAccessibleInLogicalDecoding(rel))
> return horizons.catalog_oldest_nonremovable;
>
> but that's not sufficient, because
>
> #define RelationIsAccessibleInLogicalDecoding(relation) \
> (XLogLogicalInfoActive() && \
> RelationNeedsWAL(relation) && \
> (IsCatalogRelation(relation) || RelationIsUsedAsCatalogTable(relation)))
>
> it is never true if wal_level < logical. So what it is missing is the
> IsCatalogRelation(rel) || bit.

Correct.

> > The attached patch fixes this inconsistency
>
> I think I prefer applying the fix and the larger changes separately.

Feel free to change anything in that patch, it was a prototype, or
give me a notice if you want me to split the patch.

> > Another approach might be changing GlobalVisTestFor(rel) instead to
> > reflect the conditions in GetOldestNonRemovableTransactionId.
>
> No, that'd not be correct, afaict.

Allright, I wasn't sure of that myself.

With regards,

Matthias van de Meent.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-06-10 15:24:16 Re: "an SQL" vs. "a SQL"
Previous Message David Rowley 2021-06-10 15:00:51 Re: "an SQL" vs. "a SQL"