From: Andres Freund <andres@anarazel.de>
To: Oskari Saarenmaa <os@aiven.io>
Cc: Peter Geoghegan <pg@heroku.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Peter Tripp <peter@chartio.com>
Cc: Virendra Negi <virendra@idyllic-software.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14150: Attempted to delete invisible tuple
Date: Wed, 17 Aug 2016 17:09:32 -0700
Message-ID: <20160818000932.5ugispgqu3iw3g54@alap3.anarazel.de> (raw)
In-Reply-To: <6e11604c-d8a1-93d3-63f2-a02c3048afce@aiven.io>
References: <CAM3SWZQ_8aPcxRKm9Bsy5m46WqVoirmf7PMOw6-APe-k9MfSrw@mail.gmail.com>
<6e259534-eb94-0319-dace-ee83d9535a86@aiven.io>
<20160727235347.odtjfrsrjdrlolfv@alap3.anarazel.de>
<20160728004737.5x5pakboh24234j6@alap3.anarazel.de>
<CAM3SWZQZb=6FDyhGCf9oyNfCAC+6RC+D3fEm9z6hcMHbrR3XsQ@mail.gmail.com>
<20160728010423.aepl2nk5e2ecmcfy@alap3.anarazel.de>
<CAM3SWZSVHocX3GtR2i_9mHjsYk5zCOE494TRTmJPwHhvVoUA-g@mail.gmail.com>
<CAM3SWZS0u0LcoYbeUp0TQFcR--p8LdDrMmySqXP7i_pYbnP9=w@mail.gmail.com>
<20160731223146.52zykyros7wx57t2@alap3.anarazel.de>
<6e11604c-d8a1-93d3-63f2-a02c3048afce@aiven.io>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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 <pg@heroku.com> wrote:
> > > > On Wed, Jul 27, 2016 at 6:04 PM, Andres Freund <andres@anarazel.de> 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
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: andres@anarazel.de, os@aiven.io, pg@heroku.com, michael.paquier@gmail.com, peter@chartio.com, virendra@idyllic-software.com
Subject: Re: BUG #14150: Attempted to delete invisible tuple
In-Reply-To: <20160818000932.5ugispgqu3iw3g54@alap3.anarazel.de>
References: <CAM3SWZQ_8aPcxRKm9Bsy5m46WqVoirmf7PMOw6-APe-k9MfSrw@mail.gmail.com> <6e259534-eb94-0319-dace-ee83d9535a86@aiven.io> <20160727235347.odtjfrsrjdrlolfv@alap3.anarazel.de> <20160728004737.5x5pakboh24234j6@alap3.anarazel.de> <CAM3SWZQZb=6FDyhGCf9oyNfCAC+6RC+D3fEm9z6hcMHbrR3XsQ@mail.gmail.com> <20160728010423.aepl2nk5e2ecmcfy@alap3.anarazel.de> <CAM3SWZSVHocX3GtR2i_9mHjsYk5zCOE494TRTmJPwHhvVoUA-g@mail.gmail.com> <CAM3SWZS0u0LcoYbeUp0TQFcR--p8LdDrMmySqXP7i_pYbnP9=w@mail.gmail.com> <20160731223146.52zykyros7wx57t2@alap3.anarazel.de> <6e11604c-d8a1-93d3-63f2-a02c3048afce@aiven.io> <20160818000932.5ugispgqu3iw3g54@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