Re: HOT chain validation in verify_heapam() - Mailing list pgsql-hackers

From Robert Haas
Subject Re: HOT chain validation in verify_heapam()
Date
Msg-id CA+TgmobLypZx=cOH+yY1GZmCruaoucHm77A6y_-Bo=h-_3H28g@mail.gmail.com
Whole thread Raw
In response to Re: HOT chain validation in verify_heapam()  (Andres Freund <andres@anarazel.de>)
Responses Re: HOT chain validation in verify_heapam()  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Thu, Mar 23, 2023 at 1:26 PM Andres Freund <andres@anarazel.de> wrote:
> E.g. continuing after:
>
>                                 rditem = PageGetItemId(ctx.page, rdoffnum);
>                                 if (!ItemIdIsUsed(rditem))
>                                         report_corruption(&ctx,
>                                                                           psprintf("line pointer redirection to
unuseditem at offset %u", 
>                                                                                            (unsigned) rdoffnum));
>
> means we'll look into the tuple in the "update chain validation" loop for
> unused items.

Ah, yes, that's a goof for sure.

> > -                 * Redirects are created by updates, so successor should be
> > -                 * the result of an update.
> > +                 * Redirects are created by HOT updates, so successor should
> > +                 * be the result of an HOT update.
> > +                 *
> > +                 * XXX: HeapTupleHeaderIsHeapOnly() should always imply
> > +                 * HEAP_UPDATED. This should be checked even when the tuple
> > +                 * isn't a target of a redirect.
> >
> > Hmm, OK. So the question is where to put this check. Maybe inside
> > check_tuple_header(), making it independent of the update chain
> > validation stuff?
>
> Yes, check_tuple_header sounds sensible to me.

OK, let me spend some more time on this and I'll post a patch (or
patches) in a bit.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)
Next
From: Andres Freund
Date:
Subject: Re: HOT chain validation in verify_heapam()