Re: snapshot too old, configured by time
От | Kevin Grittner |
---|---|
Тема | Re: snapshot too old, configured by time |
Дата | |
Msg-id | 56479263.1140984.1444945639606.JavaMail.yahoo@mail.yahoo.com обсуждение исходный текст |
Ответ на | Re: snapshot too old, configured by time (Alvaro Herrera <alvherre@2ndquadrant.com>) |
Ответы |
Re: snapshot too old, configured by time
|
Список | pgsql-hackers |
On Tuesday, September 15, 2015 12:07 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > Kevin Grittner wrote: >> Alvaro Herrera <alvherre@2ndquadrant.com> wrote: >>> I would place it inside src/test/modules, so that buildfarm >>> runs it automatically; I'm not sure it will pick up things in >>> src/test. >> >> As it stands now, the test is getting run as part of `make >> check-world`, and it seems like src/test/modules is about testing >> separate executables, so I don't think it makes sense to move the >> tests -- but I could be convinced that I'm missing something. > > It's not conceived just as a way to test separate executables; maybe it > is at the moment (though I don't think it is?) but if so that's just an > accident. The intention is to have modules that get tested without them > being installed, which wasn't the case when they were in contrib. > > The problem with check-world is that buildfarm doesn't run it. We don't > want to set up separate buildfarm modules for each subdir in src/test; > that would be pretty tedious. OK, moved. All other issues raised by Álvaro and Steve have been addressed, except for this one, which I will argue against: > So if I understand correctly, every call to BufferGetPage needs to have > a TestForOldSnapshot immediately afterwards? It seems easy to later > introduce places that fail to test for old snapshots. What happens if > they do? Does vacuum remove tuples anyway and then the query returns > wrong results? That seems pretty dangerous. Maybe the snapshot could > be an argument of BufferGetPage? There are 486 occurences of BufferGetPage in the source code, and this patch follows 36 of them with TestForOldSnapshot. This only needs to be done when a page is going to be used for a scan which produces user-visible results. That is, it is *not* needed for positioning within indexes to add or vacuum away entries, for heap inserts or deletions (assuming the row to be deleted has already been found). It seems wrong to modify about 450 BufferGetPage references to add a NULL parameter; and if we do want to make that noop change as insurance, it seems like it should be a separate patch, since the substance of this patch would be buried under the volume of that. I will add this to the November CF. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Вложения
В списке pgsql-hackers по дате отправления: