Re: BUG #17257: (auto)vacuum hangs within lazy_scan_prune()
Peter Geoghegan <pg@bowt.ie>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Ensure vacuum removes all visibly dead tuples older than OldestXmin
- 06bf404cd07b 16.4 landed
- 45ce054c02b8 14.13 landed
- dc6354c67017 15.8 landed
-
Combine freezing and pruning steps in VACUUM
- 6dbb490261a6 17.0 cited
-
Handle non-chain tuples outside of heap_prune_chain()
- 6f47f6883151 17.0 cited
-
Fix false reports in pg_visibility
- e85662df44ff 17.0 cited
-
Remove retry loop in heap_page_prune().
- 1ccc1e05ae8f 17.0 cited
-
vacuumlazy.c: document vistest and OldestXmin.
- 73f6ec3d3c8d 15.0 cited
-
Deduplicate choice of horizon for a relation procarray.c.
- d9d8aa9bb9aa 15.0 cited
-
Remove tupgone special case from vacuumlazy.c.
- 8523492d4e34 14.0 cited
-
Simplify state managed by VACUUM.
- b4af70cb2103 14.0 cited
-
Recycle nbtree pages deleted during same VACUUM.
- 9dd963ae2534 14.0 cited
-
snapshot scalability: Don't compute global horizons while building snapshots.
- dc7420c2c927 14.0 cited
-
Raise error when affecting tuple moved into different partition.
- f16241bef7cc 11.0 cited
On Wed, Jan 10, 2024 at 2:38 PM Noah Misch <noah@leadboat.com> wrote: > I don't know. That particular system experienced the infinite loop only once. While I certainly can't recreate the problem on demand, it has been seen on this same application far more than once. > > I'm referring to calls such as the > > "GetOldestNonRemovableTransactionId(NULL)" and > > "GlobalVisCheckRemovableFullXid()" calls that take place inside > > _bt_pendingfsm_finalize(). It's not like we do stuff like that in very > > many other places. > > I see what you mean about the rarity and potential importance of > "GetOldestNonRemovableTransactionId(NULL)". There's just one other caller, > vac_update_datfrozenxid(), which calls it for an unrelated cause. I just noticed another detail that adds significant weight to this theory: it looks like the problem is hit on the first tuple located on the first heap page that VACUUM scans *after* it completes its first round of index vacuuming (I'm inferring this from vacrel state, particular its lpdead_items instrumentation counter). The dead_items array is as large as possible here (just under 1 GiB), and lpdead_items is 178956692 (which uses up all of our dead_items space). VACUUM scans tens of gigabytes of heap pages before it begins this initial round of index vacuuming (according to vacrel->scanned_pages). What are the chances that all of this is just a coincidence? Low, I'd say. -- Peter Geoghegan