pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: pgnube@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8290: broken/unexpected locking behavior
Date: Tue, 9 Jul 2013 14:59:12 -0400
Message-ID: <20130709185912.GH18471@eldon.alvh.no-ip.org> (raw)
In-Reply-To: <E1UwaMw-0000VH-CD@wrigleys.postgresql.org>
References: <E1UwaMw-0000VH-CD@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

pgnube@gmail.com escribió:

> I sent the following information to pgsql-general to ask if it is expected
> locking behavior.  The only responses that I got said that the behavior is
> reproducible on 9.1 and 9.3 beta 2.
> Nobody said that this is expected locking behavior and I believe it to be a
> bug, so I am filing this bug report.
> The exact steps on how to reproduce the problem are shown below.  Thank you
> for putting together a great DB and for working on this bug report.

See here:
http://www.commandprompt.com/blogs/alvaro_herrera/2010/11/fixing_foreign_key_deadlocks/

There are further posts on the same topic in that blog.  The patch
dealing with it was finally committed for the 9.3 version, due to be
released later this year:
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=0ac5ad5134f2769ccbaefec73844f8504c...
At the bottom of the commit messages there are some message-ids on
(rather long) discussions about that patch.  You can search for them at
http://www.postgresql.org/list/ (just enter the msgid in the box and
click search).

If you try a 9.3 snapshot, you should be able to replace the FOR UPDATE
in your queries with FOR NO KEY UPDATE and there should be no deadlock.
Even if it does not, I hope the aforementioned posts explain what is
going on.

-- 
Álvaro Herrera                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 (8+ messages)  latest in thread

Message-ID: <20130709185912.GH18471@eldon.alvh.no-ip.org>
Permalink:  ../20130709185912.GH18471@eldon.alvh.no-ip.org/
Also on:    postgresql.org/message-id/20130709185912.GH18471@eldon.alvh.no-ip.org

 · 

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: alvherre@2ndquadrant.com, pgnube@gmail.com
  Subject: Re: BUG #8290: broken/unexpected locking behavior
  In-Reply-To: <20130709185912.GH18471@eldon.alvh.no-ip.org>
  References: <E1UwaMw-0000VH-CD@wrigleys.postgresql.org> <20130709185912.GH18471@eldon.alvh.no-ip.org>

* 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