diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-06-19 20:13:22 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-06-19 20:13:22 +0000 |
| commit | 6e07228728e51bf875ecc9669f63ed648aba88c9 (patch) | |
| tree | 52d514109f71ad5281d8787d8ae04db4858c2e51 /src/include/storage | |
| parent | 4c310eca2eabce72e7346af4a539ed066cbabe3e (diff) | |
| download | postgresql-6e07228728e51bf875ecc9669f63ed648aba88c9.tar.gz | |
Code review for log_lock_waits patch. Don't try to issue log messages from
within a signal handler (this might be safe given the relatively narrow code
range in which the interrupt is enabled, but it seems awfully risky); do issue
more informative log messages that tell what is being waited for and the exact
length of the wait; minor other code cleanup. Greg Stark and Tom Lane
Diffstat (limited to 'src/include/storage')
| -rw-r--r-- | src/include/storage/lmgr.h | 6 | ||||
| -rw-r--r-- | src/include/storage/lock.h | 12 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/include/storage/lmgr.h b/src/include/storage/lmgr.h index 19cb9095ad..36474cd278 100644 --- a/src/include/storage/lmgr.h +++ b/src/include/storage/lmgr.h @@ -7,13 +7,14 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/lmgr.h,v 1.57 2007/01/05 22:19:58 momjian Exp $ + * $PostgreSQL: pgsql/src/include/storage/lmgr.h,v 1.58 2007/06/19 20:13:22 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef LMGR_H #define LMGR_H +#include "lib/stringinfo.h" #include "storage/lock.h" #include "utils/rel.h" @@ -69,4 +70,7 @@ extern void UnlockSharedObject(Oid classid, Oid objid, uint16 objsubid, /* Knowledge about which locktags describe temp objects */ extern bool LockTagIsTemp(const LOCKTAG *tag); +/* Describe a locktag for error messages */ +extern void DescribeLockTag(StringInfo buf, const LOCKTAG *tag); + #endif /* LMGR_H */ diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h index 559ea1cec3..e2a5bc7b6f 100644 --- a/src/include/storage/lock.h +++ b/src/include/storage/lock.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.105 2007/05/30 16:16:32 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.106 2007/06/19 20:13:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -397,10 +397,12 @@ typedef enum /* Deadlock states identified by DeadLockCheck() */ typedef enum { - DS_DEADLOCK_NOT_FOUND, /* no deadlock found within database server */ - DS_SOFT_DEADLOCK, /* deadlock, but lock queues rearrangeable */ + DS_NOT_YET_CHECKED, /* no deadlock check has run yet */ + DS_NO_DEADLOCK, /* no deadlock detected */ + DS_SOFT_DEADLOCK, /* deadlock avoided by queue rearrangement */ DS_HARD_DEADLOCK /* deadlock, no way out but ERROR */ -} DeadlockState; +} DeadLockState; + /* * The lockmgr's shared hash tables are partitioned to reduce contention. @@ -449,7 +451,7 @@ extern void lock_twophase_postcommit(TransactionId xid, uint16 info, extern void lock_twophase_postabort(TransactionId xid, uint16 info, void *recdata, uint32 len); -extern DeadlockState DeadLockCheck(PGPROC *proc); +extern DeadLockState DeadLockCheck(PGPROC *proc); extern void DeadLockReport(void); extern void RememberSimpleDeadLock(PGPROC *proc1, LOCKMODE lockmode, |
