[infinispan-dev] transactions :: incremental locking

Galder Zamarreño galder at redhat.com
Fri Jul 8 05:34:58 EDT 2011


Mircea, thx for writing this up. Some comments:

It's not clear to me, at least given the examples in the wiki, how problem of Tx1 and Tx2 with a and b explained in the introduction is fixed by the solution.

The problem exposed:
"- with some right timing, during prepare time it is possible for these two transactions to deadlock:
	• Tx1 lock acquired on "a" @ N3
	• Tx2 lock acquired on "b" @ N4
	• Tx1 cannot progress acquiring  lock on "b" @ N4, that lock is acquired by Tx2
	• Tx2 cannot acquire lock on "a" @ N3 as that lock is held by Tx1
	• Tx1 and Tx2 are waiting for each other => deadlock"

The 'alleged'' solution?

"In the example above, considering the view = {N1, N2, N3, N4} and incremental lock acquisition:
	• Tx1 acquires lock on a@ N3
	• Tx2 tries to acquire lock on a@ N3. It cannot acquire and waits for Tx1 to release it
	• Tx1 acquires locks on b@ N4, completes and releases locks
	• Tx2 acquires lock on a@ N3 and completes as well"

Is the latter block supposed to show how the example in the introduction is fixed? If it is, it's not really doing it cos it's not explaining what happens to Tx2 that is trying to acquire locks on 'b'...

The diagrams and the associated explanations are confusing too. Example:

"N1 first locks a at N3 (1)" -> in the diagram, (1) represents a call from N1 to N2

"b at N4 (RPC 2)" -> That corresponds to to 5/6 arrows? 

On Jul 5, 2011, at 3:25 PM, Mircea Markus wrote:

> Hi,
> 
> This is the document describing the incremental optimistic locking Dan and myself discussed last week: http://community.jboss.org/wiki/IncrementalOptimisticLocking
> Unless I'm missing something, this together with lock reordering[1] cover 100% of the possible deadlock situations in the optimistic locking scheme[2] - which is pretty awesome!
> 
> Cheers,
> Mircea   
> 
> [1] http://community.jboss.org/wiki/LockReorderingForAvoidingDeadlocks
> [2] http://community.jboss.org/wiki/OptimisticLockingInInfinispan
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache




More information about the infinispan-dev mailing list