Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVmnv-0007Fn-OU for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Aug 2016 21:37:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bVmnu-0001NC-Lr for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Aug 2016 21:37:18 +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 1bVmnt-0001Mp-Ez for pgsql-bugs@postgresql.org; Fri, 05 Aug 2016 21:37:17 +0000 Received: from ohmu.fi ([213.157.68.249]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bVmnp-0002oA-R4 for pgsql-bugs@postgresql.org; Fri, 05 Aug 2016 21:37:16 +0000 Received: from [127.0.0.1] (localhost [IPv6:::1]) by ohmu.fi (Postfix) with ESMTP id 4DA356045A; Sat, 6 Aug 2016 00:37:09 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aiven.io; s=ohmu20151013; t=1470433029; bh=FZUjcfnMf4gMBtjmBWJAii++28xcBgoHpGR8N1TnsyU=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=STfSIfOnR9sz28VOl6NTRNgxujm51YPIZrlnjG/7jIKK+U00eRGssZuyVXCVFrtiK KUGiYvYyJ947RL5/ZML/B16D1pQnq3kJONtBG3vvsPpufYKWBQECSf0hYiAbR5Y4Ut fxx/Gb9B4QNfpJXgGzkTXOqTvEvLMUBHQS5kzZyA= Subject: Re: BUG #14150: Attempted to delete invisible tuple To: Andres Freund , Peter Geoghegan References: <62f3793f-13d6-567c-e512-f29d1fd76d00@aiven.io> <20160706214024.4bl2q3skcio4eoqk@alap3.anarazel.de> <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> Cc: Michael Paquier , Peter Tripp , Virendra Negi , pgsql-bugs@postgresql.org From: Oskari Saarenmaa Message-ID: <6e11604c-d8a1-93d3-63f2-a02c3048afce@aiven.io> Date: Sat, 6 Aug 2016 00:37:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160731223146.52zykyros7wx57t2@alap3.anarazel.de> Content-Type: multipart/mixed; boundary="------------9FCBBA8BFBB4CA7B2D014EF7" X-Pg-Spam-Score: -2.0 (--) 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 This is a multi-part message in MIME format. --------------9FCBBA8BFBB4CA7B2D014EF7 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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. Cheers, Oskari --------------9FCBBA8BFBB4CA7B2D014EF7 Content-Type: text/x-patch; name="0001-Fix-deletion-of-speculatively-inserted-TOAST-on-conf.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Fix-deletion-of-speculatively-inserted-TOAST-on-conf.pa"; filename*1="tch"