Lock freeze ? in MVCC

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "pgsql-hackers" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Lock freeze ? in MVCC
Date: 1999-04-27 03:49:13
Message-ID: 000a01be9060$ea21dae0$2801007e@cadzone.tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello all,

The following example causes the hang of concurrent
transactions(99/04/26 snapshot).

session-1 => create table tt (id int4);

session-1 => begin;
session-1 => insert into tt values (1);

session-2 => begin;
session-2 => insert into tt values (2);

session-3 => begin;
session-3 => lock table tt;
(blocked)

session-1 => update tt set id=1 where id=1;
(blocked)

session-2 => end;

session-2 returns immediately,but session-3 and session-1
are still blocked

This phenomenon seems to be caused by LockResolveCon
flicts() or DeadLockCheck().
Both session-1 and session-2 acquire RowExclusive locks
by insert operations(InitPlan() in execMain.c).
The AccessExclusive lock of session-3 is queued waiting
for the release of above locks.
When the update operation of session-1 is executed,the
second RowExclusive lock is rejected by LockResolve
Conflicts() and queued after the AccessExclusive lock
of session-3.
The state is like deadlock but DeadLockCheck() doesn't
regard the state as deadlock.

Thanks.

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-04-27 04:32:39 Re: [HACKERS] Lock freeze ? in MVCC
Previous Message Tom 1999-04-27 03:44:37 Re: [HACKERS] RE: Mysql comparison