Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a05eae0

Browse files
committed
Re-implement deadlock detection and resolution, per design notes posted
to pghackers on 18-Jan-01.
1 parent 40203e4 commit a05eae0

File tree

7 files changed

+1015
-572
lines changed

7 files changed

+1015
-572
lines changed

src/backend/storage/lmgr/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
# Makefile for storage/lmgr
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Makefile,v 1.14 2000/08/31 16:10:36 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Makefile,v 1.15 2001/01/25 03:31:16 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

1111
subdir = src/backend/storage/lmgr
1212
top_builddir = ../../../..
1313
include $(top_builddir)/src/Makefile.global
1414

15-
OBJS = lmgr.o lock.o proc.o
15+
OBJS = lmgr.o lock.o proc.o deadlock.o
1616

1717
all: SUBSYS.o
1818

src/backend/storage/lmgr/README

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$Header: /cvsroot/pgsql/src/backend/storage/lmgr/README,v 1.6 2001/01/22 22:30:06 tgl Exp $
1+
$Header: /cvsroot/pgsql/src/backend/storage/lmgr/README,v 1.7 2001/01/25 03:31:16 tgl Exp $
22

33
There are two fundamental lock structures: the per-lockable-object LOCK
44
struct, and the per-lock-holder HOLDER struct. A LOCK object exists
@@ -373,7 +373,8 @@ time with "C before B", which won't move C far enough up. So we look for
373373
soft edges outgoing from C starting at the front of the wait queue.
374374

375375
5. The working data structures needed by the deadlock detection code can
376-
be proven not to need more than MAXBACKENDS entries. Therefore the
377-
working storage can be statically allocated instead of depending on
378-
palloc(). This is a good thing, since if the deadlock detector could
379-
fail for extraneous reasons, all the above safety proofs fall down.
376+
be limited to numbers of entries computed from MaxBackends. Therefore,
377+
we can allocate the worst-case space needed during backend startup.
378+
This seems a safer approach than trying to allocate workspace on the fly;
379+
we don't want to risk having the deadlock detector run out of memory,
380+
else we really have no guarantees at all that deadlock will be detected.

0 commit comments

Comments
 (0)