Search Postgresql Archives

deadlock detected errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to locate the source of some deadlocks that have started
cropping up recently, with little success, and I have a question regarding
the message that accompanies them.

The message my application gets is like this:
Process 244 waits for ShareLock on transaction 39523645; blocked by
process 74242.
Process 74242 waits for ShareLock on tuple (65,2) of relation 16708 of
database
16386; blocked by process 244.

But in investigating various places in my code that could be relevant, and
executing the statements manually, my deadlock messages always look like
this:
 Process 38158 waits for ShareLock on transaction 15691; blocked by
process 38160.
Process 38160 waits for ShareLock on transaction 15698; blocked by process
38158.

The difference I'm asking about is that my artificial ones always involve
waiting on a transaction, while the ones from the real application always
involve one transaction wait and one tuple wait.

The first question is, is there any significance to this difference?

If so, the second question is, what is it? :) In looking at some code in
heapam.c, I see the following comment that sorta kinda sounds like maybe
there are three parties involved, with two of them waiting on a locked
tuple?

   * Acquire tuple lock to establish our priority for the tuple.
   * LockTuple will release us when we are next-in-line for the tuple.

Thanks for any help,
Clarence




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux