Re: snapshot too old issues, first around wraparound and then more.
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Geoghegan <pg@bowt.ie>, Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Kevin Grittner <kgrittn@gmail.com>
Date: 2020-04-17T05:17:18Z
Lists: pgsql-hackers
Attachments
- v1-0001-Expose-oldSnapshotControl.patch (text/x-patch) patch v1-0001
- v1-0002-contrib-old_snapshot-time-xid-mapping.patch (text/x-patch) patch v1-0002
- v1-0003-Fix-bugs-in-MaintainOldSnapshotTimeMapping.patch (text/x-patch) patch v1-0003
- v1-0004-Add-pg_clobber_current_snapshot_timestamp.patch (text/x-patch) patch v1-0004
- v1-0005-Truncate-old-snapshot-XIDs-before-truncating-CLOG.patch (text/x-patch) patch v1-0005
On Fri, Apr 17, 2020 at 3:37 PM Thomas Munro <thomas.munro@gmail.com> wrote: > On Mon, Apr 13, 2020 at 5:14 PM Andres Freund <andres@anarazel.de> wrote: > > FWIW, I think the part that is currently harder to fix is the time->xmin > > mapping and some related pieces. Second comes the test > > infrastructure. Compared to those, adding additional checks for old > > snapshots wouldn't be too hard - although I'd argue that the approach of > > sprinkling these tests everywhere isn't that scalable... > > Just trying out some ideas here... > ... so I guess maybe I'll > need to go and figure out how to write some perl. Here's a very rough sketch of what I mean. Patches 0001-0003 are stolen directly from Robert. I think 0005's t/001_truncate.pl demonstrates that the map is purged of old xids as appropriate. I suppose this style of testing based on manually advancing the hands of time should also allow for testing early pruning, but it may be Monday before I can try that so I'm sharing what I have so far in case it's useful... I think this really wants to be in src/test/modules, not contrib, but I just bolted it on top of what Robert posted.
Commits
-
Remove the "snapshot too old" feature.
- f691f5b80a85 17.0 landed
-
Improve timeout.c's handling of repeated timeout set/cancel.
- 09cf1d522676 14.0 cited
-
Fix two bugs in MaintainOldSnapshotTimeMapping.
- 55b7e2f4d78d 14.0 cited