> On Jul 6, 2021, at 2:27 PM, Peter Geoghegan <pg@bowt.ie> wrote:
>
> It looks like amcheck's verify_heapam.c functionality almost catches
> bugs like this one. Something for Mark (CC'd) to consider. Does it
> matter that we usually "ctx.oldest_xid = ctx.relfrozenxid", and so
> usually use pg_class.relfrozenxid as our oldest_xid (and not
> ShmemVariableCache->oldestXid)? In other words, could we be doing more
> to sanitize ShmemVariableCache->oldestXid, especially when the
> relation's pg_class.relfrozenxid happens to be set to a real XID?
Thanks, Peter, for drawing my attention to this. I had already been following this thread, but had not yet thought
aboutthe problem in terms of amcheck.
I will investigate possible solutions in verify_heapam().
—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company