<div dir="ltr"><div>I guess you could say this is a regression, this wouldn&#39;t have been possible when the version was part of the value :)</div><div><br></div><div>But I agree an application is very unlikely call replaceWithVersion with the same value as before, so +1 to document it for now and implement replaceWithVersion/replaceWithPredicate in the embedded cache for 8.0.</div><div><br></div><div>Cheers</div><div>Dan</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 13, 2014 at 3:08 PM, Radim Vansa <span dir="ltr">&lt;<a href="mailto:rvansa@redhat.com" target="_blank">rvansa@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I agree with Galder, fixing it is not worth the cost.<br>
<br>
Actually, there are often bugs that I&#39;d call rather &#39;quirks&#39;, not<br>
honoring the ConcurrentMap contract (recently we have discussed with Dan<br>
[1] and [2]) which are quite complex to fix. Another one that&#39;s<br>
considered not a bug is that a read does not have transactional semantics.<br>
Galder, where will you document that? I think that special page in<br>
documentation should accumulate such cases, linked to JIRAs for case<br>
that eventually we&#39;ll resolve them (with that glorious MVCC). And of<br>
course, link from javadoc to this document (though I am not sure whether<br>
we can correctly keep that in sync with latest release. Could we have a<br>
redirection from <a href="http://infinispan.org/docs/latest" target="_blank">http://infinispan.org/docs/latest</a> to<br>
<a href="http://infinispan.org/docs/7.0.x/" target="_blank">http://infinispan.org/docs/7.0.x/</a> ?<br>
<br>
Radim<br>
<br>
[1] <a href="https://issues.jboss.org/browse/ISPN-3918" target="_blank">https://issues.jboss.org/browse/ISPN-3918</a><br>
[2] <a href="https://issues.jboss.org/browse/ISPN-4286" target="_blank">https://issues.jboss.org/browse/ISPN-4286</a><br>
<div class="HOEnZb"><div class="h5"><br>
On 11/13/2014 01:51 PM, Galder Zamarreño wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; Re: <a href="https://issues.jboss.org/browse/ISPN-4972" target="_blank">https://issues.jboss.org/browse/ISPN-4972</a><br>
&gt;<br>
&gt; Embedded cache provides atomicity of a replace() call passing in the previous value. This limitation might be lifted when we adopt Java 8 and we can pass in a lambda or similar, which can be executed right when the value is compared now, and if it returns true it’s applied. The lambda could compare both value and metadata for example.<br>
&gt;<br>
&gt; Anyway, given the current status, I’m considering whether it’s worth fixing this particular issue. Fixing the issue would require adding some kind of locking in the Hot Rod server so that the version retrieval, comparison and replace call, can all happen atomically.<br>
&gt;<br>
&gt; This is not ideal, and on top of that, as Radim said, the chances of this happening in real life are limited, or more precisely it’s effects are minimal. In other words, if two concurrent threads call replace with the same value, the end result is that the new value would be stored, but as a result of the code, both replaces would return true which is not strictly right.<br>
&gt;<br>
&gt; I’d rather document this than add unnecessary locking in the Hot Rod server where it deals with the versioned replace call.<br>
&gt;<br>
&gt; Thoughts?<br>
&gt; --<br>
&gt; Galder Zamarreño<br>
&gt; <a href="mailto:galder@redhat.com">galder@redhat.com</a><br>
&gt; <a href="http://twitter.com/galderz" target="_blank">twitter.com/galderz</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Radim Vansa &lt;<a href="mailto:rvansa@redhat.com">rvansa@redhat.com</a>&gt;<br>
JBoss DataGrid QA<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></div></div></blockquote></div><br></div>