[jbosscache-dev] GravitateDataCommand finds invalid "phantom" nodes

Manik Surtani manik at jboss.org
Fri Aug 7 07:00:12 EDT 2009


On 7 Aug 2009, at 10:18, Manik Surtani wrote:

> Thanks for the patch; that makes a lot of sense.  Go ahead and check
> it in to trunk.
>
> Regarding the creation of nodes for deletion, well that's pessimistic
> locking for you.  Unfortunately the lock is encapsulated in the node
> so you can't acquire the lock until the node is created.  (Which is
> partially why the pessimistic lock design sucks).
>
> This is created in PessimisticNodeBasedLockManager (line 145).  At
> this stage we already know if we are just creating a dummy node for
> deletion, so perhaps we could pass this as a flag into the constructor
> of a PessimisticUnversionedNode, and this could acquire the lock on
> creation.  Hmm, need to think about this.

Right, so I have created a patch for this - it isn't the prettiest in  
that it exposes some PessimisticUnversionedNode internals to the  
PessimisticNodeBasedLockManager, but these two (deprecated) classes  
are so tightly coupled anyway that if this fixes the race then I'm  
happy to go with it.

Just as an FYI, this is checked in as rev. 8167.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Remove_node_creation_race.patch
Type: application/octet-stream
Size: 5642 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/jbosscache-dev/attachments/20090807/96104a06/attachment.obj 
-------------- next part --------------



Cheers
--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org






More information about the jbosscache-dev mailing list