Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic - Mailing list pgsql-hackers

From Matthias van de Meent
Subject Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic
Date
Msg-id CAEze2WgHq8QBBF=_AT5WrR5Mprs5gnv3n96gLFO6y15fPC_xMQ@mail.gmail.com
Whole thread Raw
In response to Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Wed, 9 Jun 2021 at 20:45, Andres Freund <andres@anarazel.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.



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: "an SQL" vs. "a SQL"
Next
From: Tom Lane
Date:
Subject: Re: "an SQL" vs. "a SQL"