Re: pgsql: Avoid improbable PANIC during heap_update.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Avoid improbable PANIC during heap_update.
Date: 2022-09-30 21:39:20
Message-ID: CAH2-Wz=Apna8uQAxdBUTTZX10baV-MsT9FyV6o-ifZD+knwVEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Sep 30, 2022 at 2:28 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec> writes:
> > Just to confirm I saw this on RC1
>
> Ugh ... I think I see the problem. There's still one path through
> RelationGetBufferForTuple that fails to guarantee that it's acquired
> a vmbuffer pin if the all-visible flag becomes set in the otherBuffer.

> It'd still be good to have a test case for this ...

FWIW it seems possible that the Postgres 15 vacuumlazy.c work that
added lazy_scan_noprune() made this scenario more likely in practice
-- even compared to Postgres 14.

Note that VACUUM will collect preexisting LP_DEAD items in heap pages
that cannot be cleanup locked during VACUUM's first heap pass in
Postgres 15 (in lazy_scan_noprune). There is no need for a cleanup
lock in the second heap pass, either (that details is the same as 14,
but not earlier versions). So 15 is the first version that doesn't
need a cleanup lock in either the first heap pass or the second heap
pass to be able to set the heap page all-visible. That difference
seems like it could be "protective" on 14, especially when vacuuming
smaller tables.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2022-09-30 21:52:30 Re: pgsql: Avoid improbable PANIC during heap_update.
Previous Message Tom Lane 2022-09-30 21:28:51 Re: pgsql: Avoid improbable PANIC during heap_update.

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2022-09-30 21:47:28 Re: predefined role(s) for VACUUM and ANALYZE
Previous Message Tom Lane 2022-09-30 21:28:51 Re: pgsql: Avoid improbable PANIC during heap_update.