diff options
| author | Marc G. Fournier <scrappy@hub.org> | 1997-02-12 05:25:13 +0000 |
|---|---|---|
| committer | Marc G. Fournier <scrappy@hub.org> | 1997-02-12 05:25:13 +0000 |
| commit | fb70587c1d5e111dfe63893c4dd934b430267ef5 (patch) | |
| tree | 930f745f0705a3b6da38f83581bd6ee4df7e7582 /src/backend/storage/lmgr/proc.c | |
| parent | ba82bb3eacdeef77377b8a9dc9126c506d3f7b11 (diff) | |
| download | postgresql-fb70587c1d5e111dfe63893c4dd934b430267ef5.tar.gz | |
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.
Diffstat (limited to 'src/backend/storage/lmgr/proc.c')
| -rw-r--r-- | src/backend/storage/lmgr/proc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index a9b578b353..bfbeffb45c 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -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 * ------------------------ |
