yaxing/ads_con_ctrl — Issue #3: R/W lock issue
Author: yaxing
Created: 2011-11-10 06:01:11+00:00
State: open

Since we're using 2-phase locking and read lock is not exclusive, so one variable might be read-locked by multiple transactions? If so, which transaction should be killed in following situation (wait-die):

Begin(T1)
Begin(T2)
Begin(T3)
...
R(T1, X1)
R(T3, X1)
W(T2, X2)
...

X1 would be read-locked by both T1 & T3, therefore, T2 would conflict with both of them.
But T1 is younger than T2, meaning T1 should be aborted.
However, T3 is older than T2, meaning T2 should be aborted?

Any idea?