Re: snapshot too old issues, first around wraparound and then more.
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Kevin Grittner <kgrittn@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2020-04-01T20:24:54Z
Lists: pgsql-hackers
On Wed, Apr 1, 2020 at 3:43 PM Andres Freund <andres@anarazel.de> wrote: > The thing that makes me really worried is that the contents of the time > mapping seem very wrong. I've reproduced query results in a REPEATABLE > READ transaction changing (pruned without triggering an error). And I've > reproduced rows not getting removed for much longer than than they > should, according to old_snapshot_threshold. I think it would be a good idea to add a system view that shows the contents of the mapping. We could make it a contrib module, if you like, so that it can even be installed on back branches. We'd need to move the structure definition from snapmgr.c to a header file, but that doesn't seem like such a big deal. Maybe that contrib module could even have some functions to simulate aging without the passage of any real time. Like, say you have a function or procedure old_snapshot_pretend_time_has_passed(integer), and it moves oldSnapshotControl->head_timestamp backwards by that amount. Maybe that would require updating some other fields in oldSnapshotControl too but it doesn't seem like we'd need to do a whole lot. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
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