Re: snapshot too old issues, first around wraparound and then more.
От | Thomas Munro |
---|---|
Тема | Re: snapshot too old issues, first around wraparound and then more. |
Дата | |
Msg-id | CA+hUKGJ82KqaMrvSN2e-LHVF9xWpgVQCHCeCMZJEuZytJcuTdw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: snapshot too old issues, first around wraparound and then more. (Andres Freund <andres@anarazel.de>) |
Ответы |
Re: snapshot too old issues, first around wraparound and then more.
Re: snapshot too old issues, first around wraparound and then more. |
Список | pgsql-hackers |
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... I suppose the wrapping problem just requires something along the lines of the attached, but now I'm wondering how to write decent tests for it. Using the pg_clobber_current_snapshot_timestamp() function I mentioned in Robert's time->xmin thread, it's easy to build up a time map without resorting to sleeping etc, with something like: select pg_clobber_current_snapshot_timestamp('3000-01-01 00:00:00Z'); select pg_current_xact_id(); select pg_clobber_current_snapshot_timestamp('3000-01-01 00:01:00Z'); select pg_current_xact_id(); select pg_clobber_current_snapshot_timestamp('3000-01-01 00:02:00Z'); select pg_current_xact_id(); select pg_clobber_current_snapshot_timestamp('3000-01-01 00:03:00Z'); select pg_current_xact_id(); select pg_clobber_current_snapshot_timestamp('3000-01-01 00:04:00Z'); Then of course frozenXID can be advanced with eg update pg_database set datallowconn = 't' where datname = 'template0', then vacuumdb --freeze --all, and checked before and after with Robert's pg_old_snapshot_time_mapping() SRF to see that it's truncated. But it's not really the level of stuff we'd ideally mess with in pg_regress tests and I don't see any precent, so I guess maybe I'll need to go and figure out how to write some perl.
Вложения
В списке pgsql-hackers по дате отправления: