Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1baAtv-0002MH-TN for pgsql-bugs@arkaria.postgresql.org; Thu, 18 Aug 2016 00:09:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1baAtv-0008Bc-G6 for pgsql-bugs@arkaria.postgresql.org; Thu, 18 Aug 2016 00:09:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1baAtv-0008BV-1I for pgsql-bugs@postgresql.org; Thu, 18 Aug 2016 00:09:39 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1baAtr-0000tu-Jv for pgsql-bugs@postgresql.org; Thu, 18 Aug 2016 00:09:38 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 6BA11204CA; Wed, 17 Aug 2016 20:09:34 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Wed, 17 Aug 2016 20:09:34 -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=cDChcPK60pluWgWLucF/bQTR3BI=; b=M7c1k nl7PR9Rq80z+wjfN6fTOLZG7zyuGntqJDkypYVlyddVT0ouwO9XUTK/eAIX75HWl 3hxA4r5ZbvrKUbV9LW/ZQfgpDn1H6rRzY7Oym33VLr0WDqZmzCdbZREuifqIyslF Li5EbmbshxeTCesfJ9yOsB3Ei63FpGFakX2D/8= X-Sasl-enc: KesA+VzSjN+4jWF1iC9CoyDLvS7KpHb/agwkkoE0ivjo 1471478974 Received: from intern.anarazel.de (somacentral1.static.monkeybrains.net [162.217.75.74]) by mail.messagingengine.com (Postfix) with ESMTPA id 141EECCE68; Wed, 17 Aug 2016 20:09:34 -0400 (EDT) Date: Wed, 17 Aug 2016 17:09:32 -0700 From: Andres Freund To: Oskari Saarenmaa Cc: Peter Geoghegan , Michael Paquier , Peter Tripp , Virendra Negi , pgsql-bugs@postgresql.org Subject: Re: BUG #14150: Attempted to delete invisible tuple Message-ID: <20160818000932.5ugispgqu3iw3g54@alap3.anarazel.de> References: <6e259534-eb94-0319-dace-ee83d9535a86@aiven.io> <20160727235347.odtjfrsrjdrlolfv@alap3.anarazel.de> <20160728004737.5x5pakboh24234j6@alap3.anarazel.de> <20160728010423.aepl2nk5e2ecmcfy@alap3.anarazel.de> <20160731223146.52zykyros7wx57t2@alap3.anarazel.de> <6e11604c-d8a1-93d3-63f2-a02c3048afce@aiven.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e11604c-d8a1-93d3-63f2-a02c3048afce@aiven.io> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2016-08-06 00:37:08 +0300, Oskari Saarenmaa wrote: > 01.08.2016, 01:31, Andres Freund kirjoitti: > > On 2016-07-29 17:37:21 -0700, Peter Geoghegan wrote: > > > On Wed, Jul 27, 2016 at 6:12 PM, Peter Geoghegan wrote: > > > > On Wed, Jul 27, 2016 at 6:04 PM, Andres Freund wrote: > > > > > That it needs a test, or that it's easy to do? > > > > > > > > That it's easy to write one. > > > > > > I'll be more concrete: I don't see what choke point is available to > > > make control yield after the pre-check determines there is no > > > conflict, but before index tuple insertion determines that there is in > > > fact a conflict (to reliably trigger a failed specualtive > > > insertion/super deletion). > > > > An expression index over a function acquiring a lock looks like it > > should do the trick. > > > > Are you looking in writing an updated patch? It seems we're on one page > > of the rough direction. > > Thanks for the review and the locking index idea for a test case. Attached a > further simplified patch to fix the issue plus an isolation test case for > it. Thanks. I pushed a lightly editorialized version of this. The changes primarily were around the regression test: 1) The test originally hung for me every few executions - there's no guarantee whether s2 or s3 gets to run first. Removing the transaction from the inserting xacts should do the trick. 2) The random function doesn't actually return anything random. 3) I thought the test needed some explanation. Unfortunately the test doesn't work on <9.6 (no way to wait for two blocked sessions back then), so I had to remove the tests for 9.5. Regards, Andres Freund -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs