I've been experimenting with concurrent VACUUMs and getting occasional
instances of

NOTICE:  Deadlock detected -- See the lock(l) manual page for a possible cause.
ERROR:  WaitOnLock: error on wakeup - Aborting this transaction

It would be really nice if I could find out the particular locks that
are causing this conflict --- but the code that emits these messages
isn't very transparent :-(.  Can anyone explain how to determine just
what the deadlock is?

			regards, tom lane

Sun, 28 Nov 1999 23:31:49 -0500
Tom Lane <tgl@sss.pgh.pa.us>
How to get info about deadlocks?
> I've been experimenting with concurrent VACUUMs and getting occasional
> instances of
> 
> NOTICE:  Deadlock detected -- See the lock(l) manual page for a possible cause.
> ERROR:  WaitOnLock: error on wakeup - Aborting this transaction
> 
> It would be really nice if I could find out the particular locks that
> are causing this conflict --- but the code that emits these messages
> isn't very transparent :-(.  Can anyone explain how to determine just
> what the deadlock is?
> 

Massimo has some.  See the top of lock.c for pg_options flags to dump
out locks.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Mon, 29 Nov 1999 01:04:41 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] How to get info about deadlocks?
> > I've been experimenting with concurrent VACUUMs and getting occasional
> > instances of
> > 
> > NOTICE:  Deadlock detected -- See the lock(l) manual page for a possible cause.
> > ERROR:  WaitOnLock: error on wakeup - Aborting this transaction
> > 
> > It would be really nice if I could find out the particular locks that
> > are causing this conflict --- but the code that emits these messages
> > isn't very transparent :-(.  Can anyone explain how to determine just
> > what the deadlock is?
> > 
> 
> Massimo has some.  See the top of lock.c for pg_options flags to dump
> out locks.

Yes, there is a DumpAllLocks() which should dump the lock table in case of
deadlock, but I have never been able to find any useful information from it.
The code is non compiled by default unless you define DEADLOCK_DEBUG.

-- 
Massimo Dal Zotto

+----------------------------------------------------------------------+
|  Massimo Dal Zotto               email: dz@cs.unitn.it               |
|  Via Marconi, 141                phone: ++39-0461534251              |
|  38057 Pergine Valsugana (TN)      www: http://www.cs.unitn.it/~dz/  |
|  Italy                             pgp: finger dz@tango.cs.unitn.it  |
+----------------------------------------------------------------------+

Mon, 29 Nov 1999 18:47:08 +0100 (MET)
Massimo Dal Zotto <dz@cs.unitn.it>
Re: [HACKERS] How to get info about deadlocks?
Well, you have a bit table that indicates what locks are already held and
it's being AND'ed one indicating with the locks you hold. If they overlap,
you're in trouble.

Have you turned on LOCK_MGR_DEBUG? I'd print out the masks if the lock dump
routine doesn't already.

Tom Lane wrote:
> 
> I've been experimenting with concurrent VACUUMs and getting occasional
> instances of
> 
> NOTICE:  Deadlock detected -- See the lock(l) manual page for a possible cause.
> ERROR:  WaitOnLock: error on wakeup - Aborting this transaction
> 
> It would be really nice if I could find out the particular locks that
> are causing this conflict --- but the code that emits these messages
> isn't very transparent :-(.  Can anyone explain how to determine just
> what the deadlock is?
> 
>                         regards, tom lane
> 
> ************

Mon, 29 Nov 1999 20:46:30 -0500
Tim Holloway <mtsinc@southeast.net>
Re: [HACKERS] How to get info about deadlocks?