Re: new heapcheck contrib module
| От | Peter Geoghegan |
|---|---|
| Тема | Re: new heapcheck contrib module |
| Дата | |
| Msg-id | CAH2-WzkxNMU+44XdFbPO3g--VmSdv9ByJUcVp8gGkpNZ=Zhg-A@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: new heapcheck contrib module (Robert Haas <robertmhaas@gmail.com>) |
| Ответы |
Re: new heapcheck contrib module
|
| Список | pgsql-hackers |
On Mon, Sep 21, 2020 at 2:09 PM Robert Haas <robertmhaas@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
В списке pgsql-hackers по дате отправления: