pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Sandro Santilli <strk@keybit.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: uninterruptable loop: concurrent delete in progress within table
Date: Fri, 30 May 2014 17:54:42 +0200
Message-ID: <20140530155442.GE30516@awork2.anarazel.de> (raw)
In-Reply-To: <20140530153322.GD30516@awork2.anarazel.de>
References: <20140530143150.GA11051@localhost>
	<20140530144535.GA30516@awork2.anarazel.de>
	<20140530145910.GC11051@localhost>
	<20140530152803.GA13871@localhost>
	<20140530153322.GD30516@awork2.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2014-05-30 17:33:22 +0200, Andres Freund wrote:
> > Actually, I further reduced it to not rely on PostGIS
> > and it is attached here.
> 
> Thanks. I've reproduced it and I am looking at it right now.

The problem is that HeapTupleSatisfiesVacuum() doesn't really check xmax
in the TransactionIdIsInProgress(HeapTupleHeaderGetRawXmin(tuple))
case. That seems to be a longstanding omission.
Thus the case where xmin = current xid, xmax = aborted subtransaction of
the current backend isn't handled correctly an
HEAPTUPLE_DELETE_IN_PROGRESS is returned. That in turn leads to an
endless goto loop in IndexBuildHeapScan() because waiting for an aborted
xact doesn't do much good.

That itself is obviously easy to fix, but I wonder whether there aren't
other such omissions in HeapTupleSatisfiesVacuum() - from the looks of
it it wasn't originally written to support the case where the current
xact performed changes itself. Not generally unreasonable, but long
since obsolete.

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: <20140530155442.GE30516@awork2.anarazel.de>
Permalink:  ../20140530155442.GE30516@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20140530155442.GE30516@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, strk@keybit.net
  Subject: Re: uninterruptable loop: concurrent delete in progress within table
  In-Reply-To: <20140530155442.GE30516@awork2.anarazel.de>
  References: <20140530143150.GA11051@localhost> <20140530144535.GA30516@awork2.anarazel.de> <20140530145910.GC11051@localhost> <20140530152803.GA13871@localhost> <20140530153322.GD30516@awork2.anarazel.de> <20140530155442.GE30516@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