[infinispan-dev] ISPN-2164 Why does a conditional remove (on it's own), end up with a write skew check?

Galder Zamarreño galder at redhat.com
Tue Jul 24 04:54:57 EDT 2012


On Jul 23, 2012, at 4:49 PM, Mircea Markus wrote:

> 
> On 20 Jul 2012, at 16:21, Galder Zamarreño wrote:
> 
>> Hi,
>> 
>> Re: https://issues.jboss.org/browse/ISPN-2164 and https://github.com/infinispan/infinispan/pull/1221
>> 
>> It could be argued that a remove, regardless of whether it's conditional or not, should not need to have the need for a write skew check, unless there's really been a read before. 
> +1.

Right, in that case there's a bug somewhere else, because under concurrent removals, even if the remove did not remove, it returns non-null. Agree?

> 
>> 
>> IOW, the test now passes because the commit throws an exception in 4 out of 5 threads. But, the test could/should maybe work in such way that no exception was thrown and 4 out of 5 invocations returned false to the checks made (conditional remove returns false, or normal remove returns null).
>> 
> It is possible that multiple tx return the same non-null existing value - I've commented more on the JIRA.

Is it possible under concurrent modification circumstances? 

If you have 5 concurrent removals, one should do the job and the others should be no-ops. IOW, 1/5 of the removes should return non-null and the other 4/5 should return null. This is not the case today.

The only reason his test passes with the workaround is cos of the write skew check. If that's removed, the test does not pass neither with remove(k), nor remove(k, v).

> 
>> Cheers,
>> --
>> Galder Zamarreño
>> Sr. Software Engineer
>> Infinispan, JBoss Cache
>> 
>> 
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
> 
> 
> _______________________________________________
> 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