pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Kevin Grittner <kgrittn@gmail.com>
Cc: Ants Aasma <ants.aasma@eesti.ee>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Kevin Grittner <kgrittn@postgresql.org>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: pgsql-committers@postgresql.org <pgsql-committers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
Date: Tue, 24 May 2016 13:54:51 -0700
Message-ID: <20160524205451.22pycf7ra3ilm6yq@alap3.anarazel.de> (raw)
In-Reply-To: <CACjxUsN7VNe_q0xGA7xfoTM_yqQXpqOTjhk4CQ479fQthhEFfg@mail.gmail.com>
References: <171569342.34745.1461078735421@RIA>
	<CA+CSw_tqckBCfrTgMyQOBGscM=5t7qYzBS94udGUOFWiOLeHbw@mail.gmail.com>
	<CACjxUsNO=fwsug6yWUcbt=SW5ZjGBqA35ToWgN8LMoAMMMaS3A@mail.gmail.com>
	<20160506220728.bgyxet73t6s3hjiw@alap3.anarazel.de>
	<CACjxUsNmsE-c+NzDbeEX82najPs4CdhPm9MpDep1-VeEUXwegw@mail.gmail.com>
	<20160507004844.wbze4nhjqa67io2a@alap3.anarazel.de>
	<CACjxUsOwwoCsyrspbCviuYCW7zvBviHpTMLXTHY5zzD-F=CHMQ@mail.gmail.com>
	<CACjxUsNs5eomM0v_0PQ9kz3CbfGEBg4H_Bh-fT4nwcyw0jdJSQ@mail.gmail.com>
	<20160524170058.6fhenruilde4xza4@alap3.anarazel.de>
	<CACjxUsN7VNe_q0xGA7xfoTM_yqQXpqOTjhk4CQ479fQthhEFfg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 2016-05-24 14:48:35 -0500, Kevin Grittner wrote:
> On Tue, May 24, 2016 at 12:00 PM, Andres Freund <andres@anarazel.de> wrote:
> > On 2016-05-24 11:24:44 -0500, Kevin Grittner wrote:
> >> On Fri, May 6, 2016 at 8:28 PM, Kevin Grittner <kgrittn@gmail.com> wrote:
> >>> On Fri, May 6, 2016 at 7:48 PM, Andres Freund <andres@anarazel.de> wrote:
> >>
> >>>> That comment reminds me of a question I had: Did you consider the effect
> >>>> of this patch on analyze? It uses a snapshot, and by memory you've not
> >>>> built in a defense against analyze being cancelled.
> 
> The primary defense is not considering a cancellation except in 30
> of the 500 places a page is used.  None of those 30 are, as far as
> I can see (upon review in response to your question), used in the
> analyze process.

Uh. How's that a defense? That seems like a recipe for corruption, not a
protection. That might be acceptable in the analyze case, but what about
e.g. concurrent index builds? E.g. IndexBuildHeapRangeScan() doesn't
seem to contain any checks against outdated blocks, and that's certainly
not ok? It appears that concurrent index builds are currently broken
from a quick skim?

> > Is there anything preventing this from becoming a problem?
> 
> The fundamental approach that the error can only appear on
> user-facing scans, not internal reads and positioning.

> Unless there is some code path that uses a scan where the snapshot
> age is checked, this cannot be a problem.  I don't see any such
> path, but if you do, please let me know, and I'll fix things.

That scares me. Not throwing an error, and not being broken are entirely
different things.

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: <20160524205451.22pycf7ra3ilm6yq@alap3.anarazel.de>
Permalink:  ../20160524205451.22pycf7ra3ilm6yq@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20160524205451.22pycf7ra3ilm6yq@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, kgrittn@gmail.com, ants.aasma@eesti.ee, amit.kapila16@gmail.com, noah@leadboat.com, robertmhaas@gmail.com, kgrittn@postgresql.org, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
  In-Reply-To: <20160524205451.22pycf7ra3ilm6yq@alap3.anarazel.de>
  References: <171569342.34745.1461078735421@RIA> <CA+CSw_tqckBCfrTgMyQOBGscM=5t7qYzBS94udGUOFWiOLeHbw@mail.gmail.com> <CACjxUsNO=fwsug6yWUcbt=SW5ZjGBqA35ToWgN8LMoAMMMaS3A@mail.gmail.com> <20160506220728.bgyxet73t6s3hjiw@alap3.anarazel.de> <CACjxUsNmsE-c+NzDbeEX82najPs4CdhPm9MpDep1-VeEUXwegw@mail.gmail.com> <20160507004844.wbze4nhjqa67io2a@alap3.anarazel.de> <CACjxUsOwwoCsyrspbCviuYCW7zvBviHpTMLXTHY5zzD-F=CHMQ@mail.gmail.com> <CACjxUsNs5eomM0v_0PQ9kz3CbfGEBg4H_Bh-fT4nwcyw0jdJSQ@mail.gmail.com> <20160524170058.6fhenruilde4xza4@alap3.anarazel.de> <CACjxUsN7VNe_q0xGA7xfoTM_yqQXpqOTjhk4CQ479fQthhEFfg@mail.gmail.com> <20160524205451.22pycf7ra3ilm6yq@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