Re: HOT chain validation in verify_heapam()

From: Himanshu Upadhyaya <upadhyaya(dot)himanshu(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HOT chain validation in verify_heapam()
Date: 2022-11-16 09:50:35
Message-ID: CAPF61jCH_BhvWqXxurW8WezePXAfF+_1trrJhH+hkmu=ZEsaQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 16, 2022 at 1:58 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Tue, Nov 15, 2022 at 2:50 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > On 2022-11-15 11:36:21 -0500, Robert Haas wrote:
> > > On Mon, Nov 14, 2022 at 5:02 PM Andres Freund <andres(at)anarazel(dot)de>
> wrote:
> > > > It seems like we should do a bit more validation within a chain of
> > > > tuples. E.g. that no live tuple can follow an !DidCommit xmin?
> > >
> > > I think this check is already present in stronger form. If we see a
> > > !DidCommit xmin, the xmin of the next tuple in the chain not only
> can't be
> > > committed, but had better be the same.
> >
> > As I think I mentioned before, I don't think the "better be the same"
> aspect
> > is correct, think subxacts. E.g.
> >
> > off 0: xmin: top, xmax: child_1
> > off 1: xmin: child_1, xmax: invalid
> >
> > If top hasn't committed yet, the current logic afaict will warn about
> this
> > situation, no? And I don't think we can generally the subxid parent at
> this
> > point, unfortunately (might have truncated subtrans).
>
> Woops, you're right.

yes, got it, have tried to test and it is giving false corruption in case
of subtransaction.
I think a better way to have this check is, we need to check that if
pred_xmin is
aborted then current_xmin should be aborted only. So there is no way that we
validate corruption with in_progress txid.

--
Regards,
Himanshu Upadhyaya
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-11-16 09:50:54 Re: Meson add host_system to PG_VERSION_STR
Previous Message Bharath Rupireddy 2022-11-16 09:35:24 Re: when the startup process doesn't (logging startup delays)