Re: Testing autovacuum wraparound (including failsafe)
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Anastasia Lubennikova <lubennikovaav@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>, Peter Geoghegan <pg@bowt.ie>
Date: 2022-02-01T02:58:55Z
Lists: pgsql-hackers
Attachments
- tap_tests_for_wraparound_emregency.patch (application/x-patch) patch
On Fri, Jun 11, 2021 at 10:19 AM Andres Freund <andres@anarazel.de> wrote: > > Hi, > > On 2021-06-10 16:42:01 +0300, Anastasia Lubennikova wrote: > > Cool. Thank you for working on that! > > Could you please share a WIP patch for the $subj? I'd be happy to help with > > it. > > I've attached the current WIP state, which hasn't evolved much since > this message... I put the test in src/backend/access/heap/t/001_emergency_vacuum.pl > but I'm not sure that's the best place. But I didn't think > src/test/recovery is great either. > Thank you for sharing the WIP patch. Regarding point (1) you mentioned (StartupSUBTRANS() takes a long time for zeroing out all pages), how about using single-user mode instead of preparing the transaction? That is, after pg_resetwal we check the ages of datfrozenxid by executing a query in single-user mode. That way, we don’t need to worry about autovacuum concurrently running while checking the ages of frozenxids. I’ve attached a PoC patch that does the scenario like: 1. start cluster with autovacuum=off and create tables with a few data and make garbage on them 2. stop cluster and do pg_resetwal 3. start cluster in single-user mode 4. check age(datfrozenxid) 5. stop cluster 6. start cluster and wait for autovacuums to increase template0, template1, and postgres datfrozenxids I put new tests in src/test/module/heap since we already have tests for brin in src/test/module/brin. I think that tap test facility to run queries in single-user mode will also be helpful for testing a new vacuum option/command that is intended to use in emergency cases and proposed here[1]. Regards, [1] https://www.postgresql.org/message-id/flat/20220128012842.GZ23027%40telsasoft.com#b76c13554f90d1c8bb5532d6f3e5cbf8 -- Masahiko Sawada EDB: https://www.enterprisedb.com/
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