Re: snapshot too old issues, first around wraparound and then more. - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: snapshot too old issues, first around wraparound and then more.
Date
Msg-id CA+hUKG+uDW+NNsss+cwk1O3X=4Ua+vN89jBQV5Sa_txuJ8mOfQ@mail.gmail.com
Whole thread Raw
In response to Re: snapshot too old issues, first around wraparound and then more.  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
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.

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: It is not documented that pg_promote can exit standby mode
Next
From: Noah Misch
Date:
Subject: Re: 001_rep_changes.pl stalls