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: Justin Pryzby <pryzby@telsasoft.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Matthias van de Meent <boekewurm+postgres@gmail.com>,
Masahiko Sawada <sawada.mshk@gmail.com>, Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2021-06-08T21:38:37Z
Lists: pgsql-hackers
Attachments
- 0001-Assert-that-restart-behavior-happens-once-only.patch (application/octet-stream) patch 0001
On Tue, Jun 8, 2021 at 2:23 PM Justin Pryzby <pryzby@telsasoft.com> wrote: > I'm not sure what you're suggesting ? Maybe I should add some NOTICES there. Here is one approach that might work: Can you check if the assertion added by the attached patch fails very quickly with your test case? This does nothing more than trigger an assertion failure in the event of retrying a second time for any given heap page. Theoretically that could happen without there being any bug -- in principle we might have to retry several times for the same page. In practice the chances of it happening even once are vanishingly low, though -- so two times strongly signals a bug. It was quite hard to hit the "goto restart" even once during my testing. There is still no test coverage for the line of code because it's so hard to hit. If you find that the assertion is hit pretty quickly with the same workload then you've all but reproduced the issue, probably in far less time. And, if you know that there were no concurrently aborting transactions then you can be 100% sure that you have reproduced the issue -- this goto is only supposed to be executed when a transaction that was in progress during the heap_page_prune() aborts after it returns, but before we call HeapTupleSatisfiesVacuum() for one of the aborted-xact tuples. It's supposed to be a super narrow thing. > I'm not sure why/if pg_statistic is special, but I guess when analyze happens, > it gets updated, and eventually processed by autovacuum. pg_statistic is probably special, though only in a superficial way: it is the system catalog that tends to be the most frequently vacuumed in practice. > In pg14, the parent table is auto-analyzed. I wouldn't expect that to matter. The "ANALYZE portion" of the VACUUM ANALYZE won't have started at the point that we get stuck. -- Peter Geoghegan
Commits
-
Deduplicate choice of horizon for a relation procarray.c.
- 3d0a4636aa4c 14.0 landed
- d9d8aa9bb9aa 15.0 landed
-
Use correct horizon when vacuuming catalog relations.
- 5a1e1d83022b 14.0 landed
-
Truncate line pointer array during VACUUM.
- 3c3b8a4b2689 14.0 cited
-
Remove tupgone special case from vacuumlazy.c.
- 8523492d4e34 14.0 cited
-
Refactor lazy_scan_heap() loop.
- 7ab96cf6b312 14.0 cited
-
snapshot scalability: Don't compute global horizons while building snapshots.
- dc7420c2c927 14.0 cited