1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

Patch from Massimo Dal Zotto <dz@cs.unitn.it>

The following patches add to the backend a new debugging flag -K which prints
a debug trace of all locking operations on user relations (those with oid
greater than 20000). The code is compiled only if LOCK_MGR_DEBUG is defined,
so the patch should be harmless if not explicitly enabled.
I'm using the code to trace deadlock conditions caused by application queries
using the command "$POSTMASTER -D $PGDATA -o '-d 1 -K 1'.
The patches are for version 6.0 dated 970126.
This commit is contained in:
Marc G. Fournier
1997-02-12 05:25:13 +00:00
parent ba82bb3eac
commit fb70587c1d
4 changed files with 161 additions and 40 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.14 1997/02/11 23:05:38 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.15 1997/02/12 05:23:54 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -46,7 +46,7 @@
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
*
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.14 1997/02/11 23:05:38 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.15 1997/02/12 05:23:54 scrappy Exp $
*/
#include <sys/time.h>
#ifndef WIN32
@@ -685,6 +685,10 @@ HandleDeadLock(int sig)
lock = MyProc->waitLock;
size = lock->waitProcs.size; /* so we can look at this in the core */
#ifdef DEADLOCK_DEBUG
DumpLocks();
#endif
/* ------------------------
* Get this process off the lock's wait queue
* ------------------------