Re: [Glue] Deadlock bug - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: [Glue] Deadlock bug
Date
Msg-id 4C6EC962.4060908@agliodbs.com
Whole thread Raw
In response to Re: Deadlock bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [Glue] Deadlock bug  (Joel Jacobson <joel@gluefinance.com>)
Re: [Glue] Deadlock bug  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
On 8/20/10 7:18 AM, Tom Lane wrote:
> It does go through without any deadlock, *if* there is no foreign key
> involved.  You didn't tell us exactly what the FK relationship is, but
> I suspect the reason for the deadlock is that one process is trying to
> update a row that references some row already updated by the other.
> That will require a row-level share lock on the referenced row, so you
> can get a deadlock.

That's correct. This is the generic example I was talking about earlier
on -hackers.  I'm not certain it's a bug per spec; I wanted to talk
through with Kevin what we *should* be doing in this situation.

This is one example of a set of user-hostile FK-related deadlock
behavior we have.  I'm just not certain it's logically possible to
improve it.

--                                  -- Josh Berkus                                    PostgreSQL Experts Inc.
                        http://www.pgexperts.com
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Parallel pg_restore versus dependencies
Next
From: Tom Lane
Date:
Subject: Re: git: uh-oh