On Mon, Sep 21, 2020 at 2:09 PM Robert Haas <robertmh...@gmail.com> wrote: > +REVOKE ALL ON FUNCTION > +verify_heapam(regclass, boolean, boolean, cstring, bigint, bigint) > +FROM PUBLIC; > > This too.
Do we really want to use a cstring as an enum-like argument? I think that I see a bug at this point in check_tuple() (in v15-0001-Adding-function-verify_heapam-to-amcheck-module.patch): > + /* If xmax is a multixact, it should be within valid range */ > + xmax = HeapTupleHeaderGetRawXmax(ctx->tuphdr); > + if ((infomask & HEAP_XMAX_IS_MULTI) && !mxid_valid_in_rel(xmax, ctx)) > + { *** SNIP *** > + } > + > + /* If xmax is normal, it should be within valid range */ > + if (TransactionIdIsNormal(xmax)) > + { Why should it be okay to call TransactionIdIsNormal(xmax) at this point? It isn't certain that xmax is an XID at all (could be a MultiXactId, since you called HeapTupleHeaderGetRawXmax() to get the value in the first place). Don't you need to check "(infomask & HEAP_XMAX_IS_MULTI) == 0" here? This does look like it's shaping up. Thanks for working on it, Mark. -- Peter Geoghegan