<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 6:35 PM, Pedro Ruivo <span dir="ltr">&lt;<a href="mailto:pedro@infinispan.org" target="_blank">pedro@infinispan.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
On 07/02/2013 04:29 PM, Dan Berindei wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Jul 2, 2013 at 5:59 PM, Pedro Ruivo &lt;<a href="mailto:pedro@infinispan.org">pedro@infinispan.org</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:pedro@infinispan.org">pedro@infinispan.org</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Hi all,<br>
&gt;<br>
&gt;     simple question: What are the consistency guaranties that is supposed to<br>
&gt;     be ensured?<br>
&gt;<br>
&gt;     I have the following scenario (happened in a test case):<br>
&gt;<br>
&gt;     NonOwner: remote get key<br>
&gt;     BackupOwner: receives the remote get and replies (with the correct<br>
&gt;     value)<br>
&gt;     BackupOwner: put in L1 the value<br>
&gt;<br>
&gt;<br>
&gt; I assume you meant NonOwner here?<br>
<br>
</div>yes<br>
<div class="im"><br>
&gt;<br>
&gt;     PrimaryOwner: [at the same time] is committing a transaction that will<br>
&gt;     update the key.<br>
&gt;     PrimaryOwer: receives the remote get after sending the commit. The<br>
&gt;     invalidation for L1 is not sent to NonOwner.<br>
&gt;<br>
&gt;<br>
&gt; At some point, BackupOwner has to execute the commit as well, and it<br>
&gt; should send an InvalidateL1Command(key) to NonOwner. However, one of the<br>
&gt; bugs that Will is working on could prevent that invalidation from<br>
&gt; working (maybe <a href="https://issues.jboss.org/browse/ISPN-2965" target="_blank">https://issues.jboss.org/browse/ISPN-2965</a>).<br>
<br>
</div>only the primary owner is sending the invalidation command.<br>
<div class="im HOEnZb"><br></div></blockquote><div><br></div><div>Oops, you&#39;re right! And I&#39;m pretty sure I made the same assumptions in my replies to Will&#39;s L1 thread...<br><br></div><div>I guess we could make it work either sending the invalidations from all the owners (slowing down writes, because most of the time we&#39;d send the same commands twice), or by sending remote get commands ONLY to the primary owner (which will slow down remote reads).<br>

<br></div><div>Staggering remote GET commands won&#39;t work, because with staggering you still have the possibility of the first request reaching the primary owner only after the second request returned and the entry was written to L1.<br>

<br></div><div>Sending the invalidations from the tx originator after the commit might work as well, but only if L1.invalidationTreshold == 0 and all the L1 invalidations are sent as multicasts.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im HOEnZb">
&gt;<br>
&gt;<br>
&gt;     The test finishes and I perform a check for the key value in all the<br>
&gt;     caches. The NonOwner returns the L1 cached value (==test fail).<br>
&gt;<br>
&gt;     IMO, this is bug (or not) depending what guaranties we provide.<br>
&gt;<br>
&gt;     wdyt?<br>
&gt;<br>
&gt;<br>
&gt; It&#39;s a bug!<br>
&gt;<br>
&gt; IMO, at least in DIST_SYNC mode with sync commit, we should guarantee<br>
&gt; that stale entries are removed from non-owners before the TM.commit()<br>
&gt; call returns on the originator.<br>
&gt;<br>
&gt; With other configurations we probably can&#39;t guarantee that, instead we<br>
&gt; should guarantee that stale entries are removed from non-owners &quot;soon&quot;<br>
&gt; after the TM.commit() call returns on the originator.<br>
&gt;<br>
&gt; I don&#39;t think it&#39;s ok to say that a stale entry can stay in L1<br>
&gt; indefinitely in any configuration - otherwise why have L1 invalidation<br>
&gt; at all?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div><div class="HOEnZb"><div class="h5">&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>
&gt;<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><br>
</div></div></blockquote></div><br></div></div>