From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Kevin Grittner <kgrittn@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Add the "snapshot too old" feature
Date: Thu, 25 Aug 2016 18:51:45 -0300
Message-ID: <20160825215145.GA290110@alvherre.pgsql> (raw)
In-Reply-To: <CACjxUsMTNGi_SfeFbxNy+GneyJfA7VZNaTqxdSox2dGnpOJvcw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Kevin Grittner wrote:
> On Thu, Aug 25, 2016 at 2:56 PM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
>
> > I'm wondering about the TestForOldSnapshot call in scanPendingInsert().
> > Why do we apply it to the metapage buffer (line 1717 in master)?
>
> If there is any chance that GinPageGetMeta(page)->head could have
> changed from a valid block number to InvalidBlockNumber or a
> different pending-list page due to a vacuum freeing pages from the
> pending-list, the metapage must be checked -- there is no other way
> to detect that data might have disappeared.
Hmm ... but the disappearing data is moved to regular GIN pages, right?
It doesn't just go away. I suppose that the error would be raised as
soon as we scan a GIN data page that, because of receiving data from the
pending list, has a newer LSN. I don't know GIN in detail but perhaps
it's possible that the data is inserted into data pages in lsn A, then
removed from the pending list in lsn B (where A < B). If the snapshot's
LSN lies in between, a spurious error would be raised.
> > FWIW I like the "revert" commit, because it easily shows me in what
> > places you considered a snapshot-too-old test and decided not to add
> > one. Bare BufferGetPage calls (the current situation) don't indicate that.
>
> I'm glad there is some value from having done that little dance. :-)
I'm sure that was an annoying thing to do, so I agree.
> Thanks for looking this over so closely!
You're welcome. I'm not actually reviewing this patch specifically,
just trying to figure out a different new feature and reading a few AMs
code while at it.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: alvherre@2ndquadrant.com, kgrittn@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Add the "snapshot too old" feature
In-Reply-To: <20160825215145.GA290110@alvherre.pgsql>
References: <CACjxUsMTNGi_SfeFbxNy+GneyJfA7VZNaTqxdSox2dGnpOJvcw@mail.gmail.com> <20160825215145.GA290110@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox