Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic

Peter Geoghegan <pg@bowt.ie>

From: Peter Geoghegan <pg@bowt.ie>
To: Andres Freund <andres@anarazel.de>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>, 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-07-16T23:13:03Z
Lists: pgsql-hackers
On Wed, Jun 16, 2021 at 1:21 PM Peter Geoghegan <pg@bowt.ie> wrote:
> Oh yeah, I think that I get it now. Tell me if this sounds right to you:
>
> It's not so much that HeapTupleSatisfiesVacuum() "disagrees" with
> heap_prune_satisfies_vacuum() in a way that actually matters to
> VACUUM. While there does seem to be a fairly mundane bug in
> GetOldestNonRemovableTransactionId() that really is a matter of
> disagreement between the two functions, the fundamental issue is
> deeper than that. The fundamental issue is that it's not okay to
> assume that the XID horizon won't go backwards. This probably matters
> for lots of reasons. The most obvious reason is that in theory it
> could cause lazy_scan_prune() to get stuck in about the same way as
> Justin reported, with the GetOldestNonRemovableTransactionId() bug.

Any update on this, Andres?

-- 
Peter Geoghegan



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.