On 3/15/12 3:42 PM, Pedro Ruivo wrote:
4 nodes, N1 to N4.
N2 is the primary owner of KeyA.
N3 is the primary owner of KeyB.
N1 is executing the transaction Tx1 which writes in A and B
N4 is executing the transaction Tx2 which writes in A and B.
Both transactions try to prepare at the same time. This scenario can
occurs (I think):
N2 -> deliver(Tx1), lock(KeyA), deliver(Tx2), tryLock(KeyA) //Tx2 is
blocked until the lock of KeyA is released
N3 -> deliver(Tx2), lock(KeyB), deliver(Tx1), tryLock(KeyB) //Tx1 is
blocked until the lock of KeyB is released
Eventually Tx1 or Tx2 (or both) will be aborted by a timeout. Is this
behavior correct? Am I missing something?
This is correct, and shows why we have collisions (deadlocks and then
backoffs) with our current 2PC scheme...
--
Bela Ban, JGroups lead (
http://www.jgroups.org)