Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>, Michael Paquier <michael@paquier.xyz>, Justin Pryzby <pryzby@telsasoft.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Masahiko Sawada <sawada.mshk@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2021-06-14T22:12:26Z
Lists: pgsql-hackers
Hi,

On 2021-06-14 11:53:47 +0200, Matthias van de Meent wrote:
> On Thu, 10 Jun 2021 at 19:43, Peter Geoghegan <pg@bowt.ie> wrote:
> >
> > On Thu, Jun 10, 2021 at 10:29 AM Matthias van de Meent
> > <boekewurm+postgres@gmail.com> wrote:
> > > I see one exit for HEAPTUPLE_DEAD on a potentially recently committed
> > > xvac (?), and we might also check against recently committed
> > > transactions if xmin == xmax, although apparently that is not
> > > implemented right now.
> >
> > I don't follow. Perhaps you can produce a test case?
> 
> If you were to delete a tuple in the same transaction that you create
> it (without checkpoints / subtransactions), I would assume that this
> would allow us to vacuum the tuple, as the only snapshot that could
> see the tuple must commit or roll back.

Right now we do not do so, but I think we talked about adding such logic
a couple times.

I think a more robust assertion than aborted-ness could be to assert
that repeated retries are not allowed to have the same "oldest xid" than
a previous retry. With oldest xid be the older of xmin/xmax?

Greetings,

Andres Freund



Commits

  1. Deduplicate choice of horizon for a relation procarray.c.

  2. Use correct horizon when vacuuming catalog relations.

  3. Truncate line pointer array during VACUUM.

  4. Remove tupgone special case from vacuumlazy.c.

  5. Refactor lazy_scan_heap() loop.

  6. snapshot scalability: Don't compute global horizons while building snapshots.