pgsql: Add a function GetLockConflicts() to lock.c to report xacts

Started by Tom Lanealmost 20 years ago1 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Log Message:
-----------
Add a function GetLockConflicts() to lock.c to report xacts holding
locks that would conflict with a specified lock request, without
actually trying to get that lock. Use this instead of the former ad hoc
method of doing the first wait step in CREATE INDEX CONCURRENTLY.
Fixes problem with undetected deadlock and in many cases will allow the
index creation to proceed sooner than it otherwise could've. Per
discussion with Greg Stark.

Modified Files:
--------------
pgsql/src/backend/commands:
indexcmds.c (r1.147 -> r1.148)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/indexcmds.c.diff?r1=1.147&r2=1.148)
pgsql/src/backend/storage/lmgr:
lock.c (r1.171 -> r1.172)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lock.c.diff?r1=1.171&r2=1.172)
pgsql/src/include/storage:
lock.h (r1.97 -> r1.98)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/lock.h.diff?r1=1.97&r2=1.98)