Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5JM0-0004sy-PV for pgsql-hackers@arkaria.postgresql.org; Tue, 24 May 2016 20:55:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b5JLz-0001GR-Dn for pgsql-hackers@arkaria.postgresql.org; Tue, 24 May 2016 20:55:03 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b5JLx-0001Ey-8L; Tue, 24 May 2016 20:55:01 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b5JLq-0000dZ-1e; Tue, 24 May 2016 20:55:00 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 02D352032D; Tue, 24 May 2016 16:54:53 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 24 May 2016 16:54:53 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=Pph+R2ElYclGp2kCwtce2FrYbB0=; b=nMVYr WBkg1BRUTAOG3dqeH0suFWmJRpIbPQkJjGeB26p8FV4se00cwSc6M7yjqpZ8yFGy BdTg1XRAxPJvFkcrh1MpAZTy4w+P5NuKQ+3JwBrVM9Ulofv8+NGlmE4Lz6o1gWYf 2AN+pPxw3Ujr0cqJdnIHWyI8gm1qMMVEpd3jGs= X-Sasl-enc: 8RODZUdU3axBNw9PaOZL7B7AD9/D+hHM/PtqKyE9AhPc 1464123292 Received: from intern.anarazel.de (somacentral.static.monkeybrains.net [162.217.75.74]) by mail.messagingengine.com (Postfix) with ESMTPA id A7DC6F29F4; Tue, 24 May 2016 16:54:52 -0400 (EDT) Date: Tue, 24 May 2016 13:54:51 -0700 From: Andres Freund To: Kevin Grittner Cc: Ants Aasma , Amit Kapila , Noah Misch , Robert Haas , Kevin Grittner , "pgsql-hackers@postgresql.org" , "pgsql-committers@postgresql.org" Subject: Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold < Message-ID: <20160524205451.22pycf7ra3ilm6yq@alap3.anarazel.de> References: <171569342.34745.1461078735421@RIA> <20160506220728.bgyxet73t6s3hjiw@alap3.anarazel.de> <20160507004844.wbze4nhjqa67io2a@alap3.anarazel.de> <20160524170058.6fhenruilde4xza4@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2016-05-24 14:48:35 -0500, Kevin Grittner wrote: > On Tue, May 24, 2016 at 12:00 PM, Andres Freund wrote: > > On 2016-05-24 11:24:44 -0500, Kevin Grittner wrote: > >> On Fri, May 6, 2016 at 8:28 PM, Kevin Grittner wrote: > >>> On Fri, May 6, 2016 at 7:48 PM, Andres Freund 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