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.