[infinispan-dev] Ideas for locking improvements

Mircea Markus mircea.markus at jboss.com
Wed May 18 08:33:04 EDT 2011


On 18 May 2011, at 12:44, Manik Surtani wrote:

> Some thoughts:
> 
> 1.  Suggesting deferring local locks till prepare-time: wouldn't this create a potentially large number of transaction failures?  Since write skews and overwriting may become a problem if this is allowed.
Not sure I get you, can you please detail.
> 
> 2.  Good point, except that how do you deal with failover, e.g., if the primary owner fails before broadcasting locks on other data owners (its peer group for a given key)?
E.g. in the digram, if N3 fails before triggering 2 then N1 will be notified and can reissue the put to the new owner. 
More interesting what happens if 2 is successful and N3 fails before ack to N1. This needs some more thought..
>  Further, doesn't this approach reduce parallelism in unicasts?  E.g., currently, N1 sends requests to N3 and N4 in parallel.  With the proposed scheme, N1 will send a request to N3, and then N3 sends one to N4, in sequence.
this is documented: the optimisation only makes sense when there's high contingency on same key.
> 
> 3.  Need to think more about this, around implications of correctness of lock acquisition is reordered.  But in terms of algorithm, sorting on identity hashcode won't work since this will be different on different requestor JVMs.  
The algorithm does NOT sort on identity hash code, but on CH. For conflict resolution (i.e. two keys that have same consistent hash) it can use object's hash code (default) or allow user to specify a hash code function if needed. 
> 
> 4.  The "alternate solution" here does not cover the case of N3 failing before it propagates the lock to N4, thereby invalidating the prepared state of both tx1 and tx2.
There's no lock propagation from N3 to N4..
>  Does this just mean that tx1 and tx2 fail/rollback?
> 
> 5.  This sounds good, except that doesn't a lock coordinator failing result in a network storm of each and every node in the cluster which had 1 or more locks on the lock coordinator now pinging the new lock coordinator with a message?  I presume these can be compacted into a single RPC per node, but still ... 
> 
> Overall, good stuff though, some very good ideas here.  :-)
> 
> Cheers
> Manik
> 
> 
> On 13 May 2011, at 11:35, Sanne Grinovero wrote:
> 
>> Hello all,
>> as some of us met recently at events, we've been discussing some
>> details about the current locking implementations and possible
>> improvements.
>> 
>> Some interesting ideas came out and we've been writing them down on
>> the wiki so that everyone can be involved:
>> http://community.jboss.org/wiki/PossibleLockingImprovements
>> 
>> as always, more feedback, comments and more suggestions are welcome.
>> Please bear with us if something is not very clear as they are drafts
>> of unimplemented ideas, so if you see something that you like to know
>> more about please start a discussion or comment about it and we'll try
>> to polish the explanation, refining the ideas.
>> 
>> Cheers,
>> Sanne
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
> 
> --
> Manik Surtani
> manik at jboss.org
> twitter.com/maniksurtani
> 
> Lead, Infinispan
> http://www.infinispan.org
> 
> 
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20110518/5695f532/attachment.html 


More information about the infinispan-dev mailing list