Re: 64-bit XIDs in deleted nbtree pages
Peter Geoghegan <pg@bowt.ie>
On Tue, Feb 16, 2021 at 11:35 AM Peter Geoghegan <pg@bowt.ie> wrote: > Isn't btvacuumcleanup() (or any other amvacuumcleanup() routine) > entitled to rely on the bulk delete stats being set in the way I've > described? I assumed that that was okay in general, but I haven't > tested parallel VACUUM specifically. Will parallel VACUUM really fail > to ensure that values in bulk stats fields (like pages_deleted and > pages_free) get set correctly for amvacuumcleanup() callbacks? I tested the pages_deleted_not_free stuff with a version of my patch that consistently calls _bt_update_meta_cleanup_info() during btvacuumcleanup(), and never during btbulkdelete(). And it works just fine -- including with parallel VACUUM. Evidently my understanding of what btvacuumcleanup() (or any other amvacuumcleanup() routine) can expect from bulk delete stats was correct. It doesn't matter whether or not parallel VACUUM happens to be involved -- it works just as well. This is good news, since of course it means that it's okay to stick to the simple approach of calculating pages_deleted_not_free. Passing pages_deleted_not_free (a.k.a. btm_last_cleanup_num_delpages) to _bt_update_meta_cleanup_info() during btvacuumcleanup() works just as well when combined with my fix for the the "IndexVacuumInfo.num_heap_tuples is inaccurate during btbulkdelete()" bug. That approach to fixing the IndexVacuumInfo.num_heap_tuples bug creates no new problems for my patch. There is still no need to think about when or how the relevant bulk delete fields (pages_deleted and pages_free) were set. And it doesn't matter whether or not parallel VACUUM is involved. (Of course it's also true that we can't do that on the backbranches. Purely because we must worry about btpo.xact/oldestBtpoXact on the backbranches. We'll probably have to teach the code in released versions to set btm_oldest_btpo_xact and btm_last_cleanup_num_heap_tuples in separate calls -- since there is no easy way to "send" the oldestBtpoXact value determined during a btbulkdelete() to a later corresponding btvacuumcleanup(). That's a bit of a kludge, but I'm not worried about it.) -- Peter Geoghegan
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Recycle nbtree pages deleted during same VACUUM.
- 9dd963ae2534 14.0 landed
-
VACUUM VERBOSE: Count "newly deleted" index pages.
- 237636183909 14.0 landed
-
Use full 64-bit XIDs in deleted nbtree pages.
- e5d8a9990304 14.0 landed
-
Fix nbtree cleanup-only VACUUM stats inaccuracies.
- 48e1291342dd 14.0 cited
-
Fix undercounting in VACUUM VERBOSE output.
- 73a076b03f1c 13.0 cited
-
Delete empty pages in each pass during GIST VACUUM.
- 4e514c6180fb 13.0 cited
-
Use full 64-bit XID for checking if a deleted GiST page is old enough.
- 6655a7299d83 13.0 cited
-
Allow VACUUM to be run with index cleanup disabled.
- a96c41feec6b 12.0 cited
-
Skip full index scan during cleanup of B-tree indexes when possible
- 857f9c36cda5 11.0 cited
-
Do index FSM vacuuming sooner.
- c79f6df75dd3 11.0 cited
-
Avoid early reuse of btree pages, causing incorrect query results.
- d3abbbebe52e 9.2.0 cited
-
Clean up API for ambulkdelete/amvacuumcleanup as per today's discussion.
- e57345975cf8 8.2.0 cited