pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Kevin Grittner <kgrittn@gmail.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Ants Aasma <ants.aasma@eesti.ee>
Cc: Kevin Grittner <kgrittn@postgresql.org>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
Date: Wed, 20 Jul 2016 11:12:13 -0700
Message-ID: <20160720181213.f4io7gc6lyc377sw@alap3.anarazel.de> (raw)
In-Reply-To: <CA+TgmobdprFoEfBmZxib09B8W5wthdU5Ozh+D2XH3mYea=3QiQ@mail.gmail.com>
References: <20160719021047.GB2027798@tornado.leadboat.com>
	<CACjxUsMujjg0peWzBdnNzWPdbMTzZj2j+KgNpEvWdFw+FGYTzA@mail.gmail.com>
	<20160719233250.nir5vyvzef7m4e7z@alap3.anarazel.de>
	<CAA4eK1JuPpk+ShSfabtGjBBdXOA05+GCbsrq=eUy0Y92a_JQQQ@mail.gmail.com>
	<1AB8F80A-D16E-4154-9497-98FBB164253D@anarazel.de>
	<CAA4eK1+XqXfkyyBRSJ0ZX8THzMS15NYq=cA5ZSB5KVytvLb51w@mail.gmail.com>
	<C9566A4D-9A6B-4CA9-8E52-45453C58B58D@anarazel.de>
	<CA+TgmoZWk1NK=kkU=v10p3YHKF6qNydttSD1v+XL2azp5PusyA@mail.gmail.com>
	<20160720163033.4c4ku7orkzl7r4an@alap3.anarazel.de>
	<CA+TgmobdprFoEfBmZxib09B8W5wthdU5Ozh+D2XH3mYea=3QiQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 2016-07-20 13:59:32 -0400, Robert Haas wrote:
> It's hard to believe that it's equally good to use the newest
> registered snapshot (which is, I think, what you will often get from
> GetActiveSnapshot()) and the oldest registered snapshot (which is what
> you will get from pairingheap_first()).  It seems to me that we need
> to analyze what happens if we choose a snapshot that is older than the
> one used to find the datum which contained the toast pointer, and
> conversely what happens if we use a snapshot that is newer than the
> one we used to find the toast pointer.

Yea, the oldest seems better.


> Here's an attempt:
> 
> 1. If we pick a snapshot that is older than the one that found the
> scan tuple, we might get a "snapshot too old" error that is not
> strictly necessary.

Right. Which still seems a lot better than essentially pessimizing
vacuuming for toast tables considerably.


> 2. If we pick a snapshot that is newer than the one that found the
> scan tuple, then haven't we failed to fix the problem?  I'm not so
> sure about this direction, but if it's OK to test an arbitrarily new
> snapshot, then I can't see why we need the test at all.

I think some argument could be construed why it'd possibly be safe, but
I feel a lot better with the other option.

Andres


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (195+ messages)  latest in thread

Message-ID: <20160720181213.f4io7gc6lyc377sw@alap3.anarazel.de>
Permalink:  ../20160720181213.f4io7gc6lyc377sw@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20160720181213.f4io7gc6lyc377sw@alap3.anarazel.de

 · 

reply

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: andres@anarazel.de, robertmhaas@gmail.com, amit.kapila16@gmail.com, kgrittn@gmail.com, noah@leadboat.com, alvherre@2ndquadrant.com, ants.aasma@eesti.ee, kgrittn@postgresql.org, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
  In-Reply-To: <20160720181213.f4io7gc6lyc377sw@alap3.anarazel.de>
  References: <20160719021047.GB2027798@tornado.leadboat.com> <CACjxUsMujjg0peWzBdnNzWPdbMTzZj2j+KgNpEvWdFw+FGYTzA@mail.gmail.com> <20160719233250.nir5vyvzef7m4e7z@alap3.anarazel.de> <CAA4eK1JuPpk+ShSfabtGjBBdXOA05+GCbsrq=eUy0Y92a_JQQQ@mail.gmail.com> <1AB8F80A-D16E-4154-9497-98FBB164253D@anarazel.de> <CAA4eK1+XqXfkyyBRSJ0ZX8THzMS15NYq=cA5ZSB5KVytvLb51w@mail.gmail.com> <C9566A4D-9A6B-4CA9-8E52-45453C58B58D@anarazel.de> <CA+TgmoZWk1NK=kkU=v10p3YHKF6qNydttSD1v+XL2azp5PusyA@mail.gmail.com> <20160720163033.4c4ku7orkzl7r4an@alap3.anarazel.de> <CA+TgmobdprFoEfBmZxib09B8W5wthdU5Ozh+D2XH3mYea=3QiQ@mail.gmail.com> <20160720181213.f4io7gc6lyc377sw@alap3.anarazel.de>

* 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