pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oskari Saarenmaa <os@aiven.io>
To: Michael Paquier <michael.paquier@gmail.com>
To: Peter Geoghegan <pg@heroku.com>
Cc: Peter Tripp <peter@chartio.com>
Cc: Virendra Negi <virendra@idyllic-software.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14150: Attempted to delete invisible tuple
Date: Wed, 6 Jul 2016 09:05:59 +0300
Message-ID: <88248a24-47d1-d575-a63f-2b56a09f82e2@aiven.io> (raw)
In-Reply-To: <CAB7nPqT4BSnyT+jK9Ys=yuHOe_v5KQ6e-yD7mzrsLC7=A2nfQA@mail.gmail.com>
References: <20160519123338.12513.20271@wrigleys.postgresql.org>
	<CAM3SWZTZGRwo40ONo8g+ePmyjjhTgkYockn_iRY4PX9Wfz045Q@mail.gmail.com>
	<CACOLnRWad2M9wA70vvjQ2GMOZMrfNkVOYVtq8+=au6JJX1oKjw@mail.gmail.com>
	<CAM3SWZT0-XQv5R1vR+Ji5V6F-GOjJbUXKV2owCaPTGhJujY0HA@mail.gmail.com>
	<CAB7nPqQSZVh==94uv8YS_WhNuaW+F1LFeA0vG+zSfxoBt5L88w@mail.gmail.com>
	<CAM3SWZRE3eYZyrJz78mTNB5nG0sB47=z+S-T8HSq3h-_2PzcYQ@mail.gmail.com>
	<CAB7nPqT4BSnyT+jK9Ys=yuHOe_v5KQ6e-yD7mzrsLC7=A2nfQA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

29.06.2016, 08:13, Michael Paquier kirjoitti:
> On Wed, Jun 29, 2016 at 8:40 AM, Peter Geoghegan <pg@heroku.com> wrote:
>> On Mon, Jun 27, 2016 at 8:28 PM, Michael Paquier
>> <michael.paquier@gmail.com> wrote:
>>> Could you post it? I'd be interested in seeing that.
>>
>> Attached is a reasonably minimal testcase, showing many "attempted to
>> delete invisible tuple" errors for me quickly and reliably. The
>> shellscript expects to be able to invoke pgbench without any custom
>> arguments, and runs the attach custom pgbench script in an infinite
>> loop. On my laptop, there is a roughly 90% chance that the script's 5
>> second pgbench runs will raise the error at least once.
>
> Thanks! I can see the problem with that. Now let's dig into it...

I ran into this yesterday on 9.5.3 and created a test case before 
noticing this thread.  My test case just inserts a single 
toast-requiring row using ON CONFLICT DO NOTHING and typically fails 
immediately:

pgbench -f random.sql -n -T 2 -c 2

random.sql:

-- CREATE TABLE vtest (id INT UNIQUE, blob BYTEA);
TRUNCATE vtest;
INSERT INTO vtest (id, blob) VALUES (1, encrypt(repeat('a', 
8192)::bytea, 'x'::bytea, 'aes')) ON CONFLICT DO NOTHING;

ISTM this is caused by toast knowing nothing about speculative 
insertion: when two backends have executed a speculative heap_insert 
with a conflicting key and the latter one tries to abort after receiving 
specConflict there's nothing in tqual.c to say that the toast rows 
associated with speculative insertion should be visible to that operation.

/ Oskari


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



view thread (58+ messages)  latest in thread

Message-ID: <88248a24-47d1-d575-a63f-2b56a09f82e2@aiven.io>
Permalink:  ../88248a24-47d1-d575-a63f-2b56a09f82e2@aiven.io/
Also on:    postgresql.org/message-id/88248a24-47d1-d575-a63f-2b56a09f82e2@aiven.io

 · 

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-bugs@postgresql.org
  Cc: os@aiven.io, michael.paquier@gmail.com, pg@heroku.com, peter@chartio.com, virendra@idyllic-software.com
  Subject: Re: BUG #14150: Attempted to delete invisible tuple
  In-Reply-To: <88248a24-47d1-d575-a63f-2b56a09f82e2@aiven.io>
  References: <20160519123338.12513.20271@wrigleys.postgresql.org> <CAM3SWZTZGRwo40ONo8g+ePmyjjhTgkYockn_iRY4PX9Wfz045Q@mail.gmail.com> <CACOLnRWad2M9wA70vvjQ2GMOZMrfNkVOYVtq8+=au6JJX1oKjw@mail.gmail.com> <CAM3SWZT0-XQv5R1vR+Ji5V6F-GOjJbUXKV2owCaPTGhJujY0HA@mail.gmail.com> <CAB7nPqQSZVh==94uv8YS_WhNuaW+F1LFeA0vG+zSfxoBt5L88w@mail.gmail.com> <CAM3SWZRE3eYZyrJz78mTNB5nG0sB47=z+S-T8HSq3h-_2PzcYQ@mail.gmail.com> <CAB7nPqT4BSnyT+jK9Ys=yuHOe_v5KQ6e-yD7mzrsLC7=A2nfQA@mail.gmail.com> <88248a24-47d1-d575-a63f-2b56a09f82e2@aiven.io>

* 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