pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Postgres-Bugs <pgsql-bugs@postgresql.org>
Cc: Sandro Santilli <strk@keybit.net>
Subject: Re: uninterruptable loop: concurrent delete in progress within table
Date: Thu, 5 Jun 2014 02:14:24 +0200
Message-ID: <20140605001424.GA15695@awork2.anarazel.de> (raw)
In-Reply-To: <CA+Tgmobx+e2furvSi2+hxV3QVQWw9YtWC-awg6-UdgfaOiWZnQ@mail.gmail.com>
References: <20140530143150.GA11051@localhost>
	<20140531132841.GC1220@awork2.anarazel.de>
	<20140602164800.GA5146@eldon.alvh.no-ip.org>
	<20140602170820.GB24145@awork2.anarazel.de>
	<20140602172716.GC5146@eldon.alvh.no-ip.org>
	<20140602173536.GE24145@awork2.anarazel.de>
	<CA+TgmoZoGhRvMv10wSUyirF2PFG7KH5xQvTOkOOmOO8BpyGvWg@mail.gmail.com>
	<20140604231049.GM785@awork2.anarazel.de>
	<CA+Tgmobx+e2furvSi2+hxV3QVQWw9YtWC-awg6-UdgfaOiWZnQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2014-06-04 19:27:54 -0400, Robert Haas wrote:
> On Wed, Jun 4, 2014 at 7:10 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> > On 2014-06-04 19:03:15 -0400, Robert Haas wrote:
> >> On Mon, Jun 2, 2014 at 1:35 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> >> > Robert: Do you remember that case?
> >> >
> >> > Alvaro: In the end it'd not be very harmful - if it happens
> >> > TransactionIdDidCommit() will return false (there's special case code
> >> > for it).
> >>
> >> Not specifically, but I'd be surprised if it isn't possible.
> >
> > Wouldn't that mean that every single visibility routine in tqual.c is
> > buggy?
> >
> > I am not convinced there aren't further bugs in some corner cases in
> > tqual.c. But even a low likelihood scenarious of
> > xmax = InvalidTransactionId && (infomask & XMAX_INVALID) == 0
> > would have become visible by now given how widespread/central those
> > tests are?
> 
> What specifically do you think will break?

If XMAX_INVALID may accidentally not be set even though there's no xmax,
other xmax flags could be bogus as well. Afaics there's no difference in
the handling between them.
And then tests for LOCKED_ONLY, IS_MULTI and such would be dodgy.

The only things that - afaics - are allowed to to change the actual xmax
transactionid are:
* freezing
* heap_(update|delete|lock)_tuple

And of those only freezing will unset xmax to InvalidTransactionId. But
it re-sets XMAX_INVALID (and clears all other xmax flags).

So I don't really see a danger. But you're right, even if there were
cases where that case happens - without any other odd flags - we'd still
be safe.

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
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 (28+ messages)  latest in thread

Message-ID: <20140605001424.GA15695@awork2.anarazel.de>
Permalink:  ../20140605001424.GA15695@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20140605001424.GA15695@awork2.anarazel.de

 · 

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: andres@2ndquadrant.com, robertmhaas@gmail.com, alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, strk@keybit.net
  Subject: Re: uninterruptable loop: concurrent delete in progress within table
  In-Reply-To: <20140605001424.GA15695@awork2.anarazel.de>
  References: <20140530143150.GA11051@localhost> <20140531132841.GC1220@awork2.anarazel.de> <20140602164800.GA5146@eldon.alvh.no-ip.org> <20140602170820.GB24145@awork2.anarazel.de> <20140602172716.GC5146@eldon.alvh.no-ip.org> <20140602173536.GE24145@awork2.anarazel.de> <CA+TgmoZoGhRvMv10wSUyirF2PFG7KH5xQvTOkOOmOO8BpyGvWg@mail.gmail.com> <20140604231049.GM785@awork2.anarazel.de> <CA+Tgmobx+e2furvSi2+hxV3QVQWw9YtWC-awg6-UdgfaOiWZnQ@mail.gmail.com> <20140605001424.GA15695@awork2.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