DeadLockCheck...

From: Vadim Mikheev <vadim(at)krs(dot)ru>
To: PostgreSQL Developers List <hackers(at)postgreSQL(dot)org>
Subject: DeadLockCheck...
Date: 1999-05-01 11:57:00
Message-ID: 372AEC0C.2364206E@krs.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

session-1:
vac=> begin;
BEGIN
vac=> lock table t in row share mode;
LOCK TABLE

session-2:
vac=> begin;
BEGIN
vac=> lock table t in row share mode;
LOCK TABLE

session-3:
vac=> begin;
BEGIN
vac=> lock table t in row exclusive mode;
LOCK TABLE

session-1:
vac=> lock table t in share row exclusive mode;
--waiting (conflicts with session-3 lock)

session-2:
vac=> lock table t in share row exclusive mode;
NOTICE: Deadlock detected -- See the lock(l) manual page for a possible cause.
ERROR: WaitOnLock: error on wakeup - Aborting this transaction

???

ShareLockExclusive mode doesn't conflict with RowShare mode
(though it is self-conflicting mode).

Comments in DeadLockCheck() say:
/*
* For findlock's wait queue, we are interested in
* procs who are blocked waiting for a write-lock on
* the table we are waiting on, and already hold a
* lock on it. We first check to see if there is an
* escalation deadlock, where we hold a readlock and
* want a writelock, and someone else holds readlock
* on the same table, and wants a writelock.
*
* Basically, the test is, "Do we both hold some lock on
* findlock, and we are both waiting in the lock
* queue?" bjm
*/

Unfortunately, this is not right test any more -:(.

Vadim

Browse pgsql-hackers by date

  From Date Subject
Next Message Vadim Mikheev 1999-05-01 15:23:28 I'm planning some changes in lmgr...
Previous Message Ulf Mehlig 1999-05-01 11:16:11 cluster truncates table name?