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@tpf.co.jp