Soft deadlocks

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Soft deadlocks
Date: 2007-06-25 14:33:04
Message-ID: 87k5tsumsf.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I'm trying to understand what a soft deadlock is as described by deadlock.c.

As best I understand if a process, A, is waiting for a lock and is being
blocked only because someone, B, is ahead of it in the queue but hasn't been
granted the conflicting lock we want to jump A ahead of B.

So if i do something like:

process X:
---------
select * from x where i=1 for share;

----------------

process B:
---------
select * from x where i=1 for update;

----------------

process A:
---------
select * from x where i=1 for share;

process A will block, but when the deadlock timeout fires it should get jumped
ahead of process B.

If that's right then, uh, it doesn't seem to be working.

Process B:

postgres=# select * from x where i = 0 for update;
LOG: process 4629 still waiting for ShareLock on transaction 7802 after 5000.149 ms

Process A:

postgres=# select * from x where i = 0 for share;
LOG: process 4631 still waiting for ShareLock on tuple (0,1) of relation 16423 of database 11408 after 5000.151 ms

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2007-06-25 14:33:56 Re: msvc and vista fun
Previous Message Magnus Hagander 2007-06-25 14:14:15 Re: msvc and vista fun