Re: BUG: Postgres 14 + vacuum_defer_cleanup_age + FOR UPDATE + UPDATE
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Mark Dilger <mark.dilger@enterprisedb.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, Andrey Borodin <amborodin86@gmail.com>, Michail Nikolaev <michail.nikolaev@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, Matthias van de Meent <boekewurm+postgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Mark Dilger <mark.dilger@enterprisedb.com>
Date: 2023-03-09T00:15:58Z
Lists: pgsql-hackers
Attachments
Hi, On 2023-02-06 13:02:05 -0800, Andres Freund wrote: > I didn't quite feel confident pushing a fix for this just before a minor > release, so I'll push once the minor releases are tagged. A quite minimal fix > to GetFullRecentGlobalXmin() in 12-13 (returning FirstNormalTransactionId if > epoch == 0 and RecentGlobalXmin > nextxid_xid), and the slightly larger fix in > 14+. Pushed that. Mark: I worked some more on the fixes for amcheck, and fixes for amcheck. The second amcheck fix ends up correcting some inaccurate output in the tests - previously xids from before xid 0 were reported to be in the future. Previously there was no test case exercising exceeding nextxid, without wrapping around into the past. I added that at the end of 004_verify_heapam.pl, because renumbering seemed too annoying. What do you think? Somewhat random note: Is it intentional that we VACUUM FREEZE test ROWCOUNT times? That's effectively O(ROWCOUNT^2), albeit with small enough constants to not really matter. I don't think we need to insert the rows one-by-one either. Changing that to a single INSERT and FREEZE shaves 10-12% off the tests. I didn't change that, but we also fire off a psql for each tuple for heap_page_items(), with offset $N no less. That seems to be another 500ms. Greetings, Andres Freund
Commits
-
Fix incorrect TAP test ordering
- 92155e15d3cf 16.0 landed
-
pg_amcheck: Minor test speedups
- a4f23f9b3cdd 16.0 landed
-
amcheck: Fix FullTransactionIdFromXidAndCtx() for xids before epoch 0
- b3a83055c235 14.8 landed
- e8a9750d03d7 15.3 landed
- 4f5d461e048b 16.0 landed
-
amcheck: Fix ordering bug in update_cached_xid_range()
- a42f515d6b45 14.8 landed
- 6d9588108a56 15.3 landed
- 16327240da29 16.0 landed
-
Fix corruption due to vacuum_defer_cleanup_age underflowing 64bit xids
- be504a3e974d 16.0 landed
- 3c92f7e9d851 12.15 landed
- e6d77f22c7a8 13.11 landed
- 324281fd5b1b 14.8 landed
- 391f08fd6804 15.3 landed
-
Add hardening to catch invalid TIDs in indexes.
- e7428a99a13f 15.0 cited
-
Use full 64-bit XID for checking if a deleted GiST page is old enough.
- 6655a7299d83 13.0 cited
-
Avoid early reuse of btree pages, causing incorrect query results.
- d3abbbebe52e 9.2.0 cited