<div dir="ltr">Pedro, I&#39;ll integrate the PR as it is, and then you can experiment with my proposal in another branch/PR.<br><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 9, 2013 at 1:48 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/09/2013 11:46 AM, Galder Zamarreņo wrote:<br>
&gt;<br>
&gt; On Jul 8, 2013, at 11:02 AM, Pedro Ruivo &lt;<a href="mailto:pedro@infinispan.org">pedro@infinispan.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Hi guys,<br>
&gt;&gt;<br>
&gt;&gt; re: ISPN-2840, ISPN-3235, ISPN-3236<br>
&gt;&gt; short: transaction isolation in repeatable read<br>
&gt;&gt;<br>
&gt;&gt; Dan came up with an idea (a good idea IMO) to change a little the logic<br>
&gt;&gt; how entries are put in the context for transactional caches.<br>
&gt;&gt;<br>
&gt;&gt; One of the Repeatable Read properties is after a key is accessed, the<br>
&gt;&gt; transaction should never see other concurrent transaction values, even<br>
&gt;&gt; if they commit first. In result, we can optimize the distributed mode by<br>
&gt;&gt; only do a remote get on the first time a transaction access a key.<br>
&gt;&gt;<br>
&gt;&gt; My idea (and the one implemented in the Pull Request)<br>
&gt;<br>
&gt; ^ Which pull req, link? You mean [1]?<br>
<br>
</div>yes<br>
<div class="im"><br>
&gt;<br>
&gt; [1] <a href="https://github.com/infinispan/infinispan/pull/1937" target="_blank">https://github.com/infinispan/infinispan/pull/1937</a><br>
&gt;<br>
&gt;&gt; was adding a flag<br>
&gt;&gt; to mark the entry as accessed. All future access to that key will not<br>
&gt;&gt; try to fetch the data from container neither from a remote location (we<br>
&gt;&gt; have a small but with last one).<br>
&gt;&gt;<br>
&gt;&gt; The Dan&#39;s idea is more simple but require some change in the<br>
&gt;&gt; EntryFactory logic.<br>
&gt;<br>
&gt; ^ Which is Dan&#39;s idea exactly?<br>
<br>
</div>is the description below:<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt;&gt; At this stage, we only put an entry in the<br>
&gt;&gt; transaction context if the following conditions are respected:<br>
&gt;&gt;<br>
&gt;&gt; * the entry exists in data container (i.e. the node is owner or it is in L1)<br>
&gt;&gt; * we put a RepeatableReadEntry with null value in the transaction context if<br>
&gt;&gt; ** the entry does not exist in the container but the node is owner<br>
&gt;&gt; ** the entry does not exist in the data container but the command has<br>
&gt;&gt; flags to skip the remote fetch (like IGNORE_RETURN_VALUE or<br>
&gt;&gt; SKIP_REMOTE_LOOKUP). Of course the conditional commands needs special<br>
&gt;&gt; attention here.<br>
&gt;&gt;<br>
&gt;&gt; Note: as usual, if the entry exists in the context, then nothing is done.<br>
&gt;&gt;<br>
&gt;&gt; At the TxDistributionInterceptor level, the check to see if the remote<br>
&gt;&gt; get should be done is simple as check if lookupEntries(k)==null.<br>
&gt;&gt;<br>
&gt;&gt; Dan, if I said something wrong let me know. If I was not clear at some<br>
&gt;&gt; point let me know too.<br>
&gt;&gt;<br>
&gt;&gt; Anyone see any issue with this approach?<br>
&gt;&gt; Any other suggestions?<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; Pedro Ruivo<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&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>
&gt;<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; Project Lead, Escalante<br>
&gt; <a href="http://escalante.io" target="_blank">http://escalante.io</a><br>
&gt;<br>
&gt; Engineer, Infinispan<br>
&gt; <a href="http://infinispan.org" target="_blank">http://infinispan.org</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>
&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></div>