Re: Testing autovacuum wraparound (including failsafe)
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Ian Lawrence Barwick <barwick@gmail.com>,
Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Andres Freund <andres@anarazel.de>,
Anastasia Lubennikova <lubennikovaav@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>, Peter Geoghegan <pg@bowt.ie>
Date: 2023-03-03T11:34:50Z
Lists: pgsql-hackers
On 16/11/2022 06:38, Ian Lawrence Barwick wrote: > Thanks for the patch. While reviewing the patch backlog, we have determined that > the latest version of this patch was submitted before meson support was > implemented, so it should have a "meson.build" file added for consideration for > inclusion in PostgreSQL 16. I wanted to do some XID wraparound testing again, to test the 64-bit SLRUs patches [1], and revived this. I took a different approach to consuming the XIDs. Instead of setting nextXID directly, bypassing GetNewTransactionId(), this patch introduces a helper function to call GetNewTransactionId() repeatedly. But because that's slow, it does include a shortcut to skip over "uninteresting" XIDs. Whenever nextXid is close to an SLRU page boundary or XID wraparound, it calls GetNewTransactionId(), and otherwise it bumps up nextXid close to the next "interesting" value. That's still a lot slower than just setting nextXid, but exercises the code more realistically. I've written some variant of this helper function many times over the years, for ad hoc testing. I'd love to have it permanently in the git tree. In addition to Masahiko's test for emergency vacuum, this includes two other tests. 002_limits.pl tests the "warn limit" and "stop limit" in GetNewTransactionId(), and 003_wraparound.pl burns through 10 billion transactions in total, exercising XID wraparound in general. Unfortunately these tests are pretty slow; the tests run for about 4 minutes on my laptop in total, and use about 20 GB of disk space. So perhaps these need to be put in a special test suite that's not run as part of "check-world". Or perhaps leave out the 003_wraparounds.pl test, that's the slowest of the tests. But I'd love to have these in the git tree in some form. [1] https://www.postgresql.org/message-id/CAJ7c6TPKf0W3MfpP2vr=kq7-NM5G12vTBhi7miu_5m8AG3Cw-w@mail.gmail.com) - Heikki
Commits
-
Fix meson installation of xid_wraparound test.
- 1aa67a5ea687 17.0 landed
-
Add tests for XID wraparound.
- e255b646a16b 17.0 landed
-
Add option to specify timeout seconds to BackgroundPsql.pm.
- 334f512f45eb 17.0 landed
-
Fix wrong description of BackgroundPsql's timeout.
- 2d758dca1b31 16.2 landed
- 5abff2aaa1ab 17.0 landed
-
Refactor background psql TAP functions
- 664d757531e1 16.0 cited
-
Consider triggering VACUUM failsafe during scan.
- c242baa4a831 14.0 landed
-
Fix autovacuum log output heap truncation issue.
- fbe9b80610fe 14.0 landed