lmgr changed

From: Vadim Mikheev <vadim(at)krasnet(dot)ru>
To: PostgreSQL Developers List <hackers(at)postgreSQL(dot)org>
Subject: lmgr changed
Date: 1999-05-14 07:53:39
Message-ID: 373BD683.7E74BA31@krasnet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

Changes:

1. Check for other waiters is moved from LockResolveConflict
to LockAquire.
2. Don't take other waiters into account if either lock
aquired by MyProc don't conflict with locks aquired by
waiters or MyProc already holds conflicting lock.
3. ProcSleep uses conflict table to order waiters. Priority
not used.
4. ProcLockWakeup stops attempts to wakeup waiters if lock
conflict found _and_ someone was already wakeuped.
5. DeadLockCheck is able to wakeup MyProc or other proc
to prevent deadlock.

Below are tests I run. Hope that lmgr issues are closed.

---

Blocked by "higher priority" lock waiting:

1:
begin;
lock t1 in row exclusive mode;
2:
begin;
lock table t1 in share row exclusive mode; -- blocked by 1
3:
begin;
lock table t2 in share row exclusive mode;
lock table t1 in row exclusive mode; -- blocked by 2
1:
lock t2 in row exclusive mode; -- blocked by 3
-- was: DeadLock: 3 waits for 2 waiting for 1
-- now: 3 granted lock on t1 and wakeuped

Blocked by other:

1:
begin;
lock t1 in row share mode;
2:
begin;
lock table t1 in row exclusive mode;
3:
begin;
lock table t2 in share row exclusive mode;
lock table t1 in share row exclusive mode; -- blocked by 2
1:
lock t2 in row exclusive mode; -- blocked by 3
-- was: DeadLock: 3 waits for lock on t1 and 1 hold lock on t1
-- now: no DeadLock: 3 blocked not by 1

Blocked by other II:

1:
begin;
lock table t1 in row share mode;
2:
begin;
lock table t1 in row exclusive mode;
3:
begin;
lock table t2 in exclusive mode;
1:
lock t2 in row share mode; -- blocked by 3
3:
lock table t1 in share row exclusive mode; -- blocked by 2
-- was: DeadLock: 3 waits for lock on t1 and 1 hold lock on t1
-- now: no DeadLock: 3 blocked not by 1
4:
begin;
lock table t3 in exclusive mode;
2:
lock table t3 in row share mode; -- blocked by 4
4:
lock table t1 in row exclusive mode; -- blocked by 3
-- was: not possible
-- now: self wakeing up

Vadim

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Bitmead 1999-05-14 11:31:57 CVS
Previous Message Tom Lane 1999-05-14 01:32:11 Re: [HACKERS] Progress on char(n) default-value problem