Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic
Date: 2021-06-10 15:49:05
Message-ID: CAEze2WgCQSUK0jR9hdDeuYPKnEctVxWNppWss_cMXGpKU2ODzw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 9 Jun 2021 at 22:45, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
>
> On Wed, Jun 9, 2021 at 11:45 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > Good find!
>
> +1
>
> > > The attached patch fixes this inconsistency
> >
> > I think I prefer applying the fix and the larger changes separately.
>
> I wonder if it's worth making the goto inside lazy_scan_prune verify
> that the heap tuple matches what we expect. I'm sure that we would
> have found this issue far sooner if that had been in place already.
> Though I'm less sure of how much value adding such a check has now.

Could you elaborate on what this "matches what we expect" entails?

Apart from this, I'm also quite certain that the goto-branch that
created this infinite loop should have been dead code: In a correctly
working system, the GlobalVis*Rels should always be at least as strict
as the vacrel->OldestXmin, but at the same time only GlobalVis*Rels
can be updated (i.e. move their horizon forward) during the vacuum. As
such, heap_prune_satisfies_vacuum should never fail to vacuum a tuple
that also satisifies the condition of HeapTupleSatisfiesVacuum. That
is, unless we're also going to change code to update / move forward
vacrel->OldestXmin in lazy_scan_prune between the HPSV call and the
loop with HTSV.

With regards,

Matthias van de Meent

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2021-06-10 15:52:46 Re: "an SQL" vs. "a SQL"
Previous Message Tom Lane 2021-06-10 15:24:16 Re: "an SQL" vs. "a SQL"