OSDN Git Service

Revise lock manager to support "session level" locks as well as "transaction
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 22 Dec 2000 00:51:54 +0000 (00:51 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 22 Dec 2000 00:51:54 +0000 (00:51 +0000)
commit6cc842abd340b6f4c3f9e5f49d59805174959f7e
tree5f92c6b6eb7fd9e556967f0e4ee1a9480fb2fd8e
parentb2145e9365ee38c68b74dae3dca803696cba69b4
Revise lock manager to support "session level" locks as well as "transaction
level" locks.  A session lock is not released at transaction commit (but it
is released on transaction abort, to ensure recovery after an elog(ERROR)).
In VACUUM, use a session lock to protect the master table while vacuuming a
TOAST table, so that the TOAST table can be done in an independent
transaction.

I also took this opportunity to do some cleanup and renaming in the lock
code.  The previously noted bug in ProcLockWakeup, that it couldn't wake up
any waiters beyond the first non-wakeable waiter, is now fixed.  Also found
a previously unknown bug of the same kind (failure to scan all members of
a lock queue in some cases) in DeadLockCheck.  This might have led to failure
to detect a deadlock condition, resulting in indefinite waits, but it's
difficult to characterize the conditions required to trigger a failure.
contrib/userlock/user_locks.c
src/backend/access/transam/xact.c
src/backend/commands/vacuum.c
src/backend/storage/ipc/ipci.c
src/backend/storage/lmgr/README
src/backend/storage/lmgr/lmgr.c
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/proc.c
src/include/storage/lmgr.h
src/include/storage/lock.h
src/include/storage/proc.h