Re: 64-bit XIDs in deleted nbtree pages
Peter Geoghegan <pg@bowt.ie>
On Wed, Feb 10, 2021 at 7:10 PM Peter Geoghegan <pg@bowt.ie> wrote: > Attached is v3 of the index. I'll describe the changes I made in more > detail in my response to your points below. I forget to mention that v3 adds several assertions like this one: Assert(!_bt_page_recyclable(BufferGetPage(buf))); These appear at a few key points inside generic routines like _bt_getbuf(). The overall effect is that every nbtree buffer access (with the exception of buffer accesses by VACUUM) will make sure that the page that they're about to access is not recyclable (a page that an index scan lands on might be half-dead or deleted, but it had better not be recyclable). This can probably catch problems with recycling pages too early, such as the problem fixed by commit d3abbbeb back in 2012. Any similar bugs in this area that may appear in the future can be expected to be very subtle, for a few reasons. For one, a page can be recyclable but not yet entered into the FSM by VACUUM for a long time. (I could go on.) The assertions dramatically improve our chances of catching problems like that early. -- 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