pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Andrew Sackville-West <awest@janrain.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: regression, deadlock in high frequency single-row UPDATE
Date: Thu, 31 Jul 2014 20:59:50 -0400
Message-ID: <20140801005950.GF5475@eldon.alvh.no-ip.org> (raw)
In-Reply-To: <20140731233051.GN17765@andrew-ThinkPad-X230>
References: <20140731233051.GN17765@andrew-ThinkPad-X230>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Andrew Sackville-West wrote:
> Hi,
> 
> I've discussed this problem on irc a couple of times and think I've
> found a regression that plagues our application, introduced in some
> version newer than 9.1.9, and still present in 9.3.5.

I don't think you have provided everything: for instance I see that your
log has INSERTs into table access_tokens, which has a foreign key
relationship to/from some other table you showed.

I'm too lazy to unscramble the whole thing into a real schema right now.
pg_dump output would be more helpful, as would some trivial sample data
enough to reproduce the problem.

It'd probably be easier to reproduce if you wrap the statements in
transactions and have them sleep before COMMIT.  (If you run two of
these updates in parallel, the first one blocks the second until the
first one commits, because they update the same row.  What happens if
the blocking session runs the aforementioned INSERT while the other is
blocked?  Perhaps three sessions are needed to show a problem without
explicit transactions.)

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

Message-ID: <20140801005950.GF5475@eldon.alvh.no-ip.org>
Permalink:  ../20140801005950.GF5475@eldon.alvh.no-ip.org/
Also on:    postgresql.org/message-id/20140801005950.GF5475@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, awest@janrain.com
  Subject: Re: regression, deadlock in high frequency single-row UPDATE
  In-Reply-To: <20140801005950.GF5475@eldon.alvh.no-ip.org>
  References: <20140731233051.GN17765@andrew-ThinkPad-X230> <20140801005950.GF5475@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