<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 4, 2014 at 10:07 AM, Galder Zamarreņo <span dir="ltr">&lt;<a href="mailto:galder@redhat.com" target="_blank">galder@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im"><br>
On 28 Jan 2014, at 15:29, William Burns &lt;<a href="mailto:mudokonman@gmail.com">mudokonman@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hello everyone,<br>
&gt;<br>
&gt; I wanted to discuss what I would say as dubious benefit of L1OnRehash<br>
&gt; especially compared to the benefits it provide.<br>
&gt;<br>
&gt; L1OnRehash is used to retain a value by moving a previously owned<br>
&gt; value into the L1 when a rehash occurs and this node no longer owns<br>
&gt; that value  Also any current L1 values are removed when a rehash<br>
&gt; occurs.  Therefore it can only save a single remote get for only a few<br>
&gt; keys when a rehash occurs.<br>
&gt;<br>
&gt; This by itself is fine however L1OnRehash has many edge cases to<br>
&gt; guarantee consistency as can be seen from<br>
&gt; <a href="https://issues.jboss.org/browse/ISPN-3838" target="_blank">https://issues.jboss.org/browse/ISPN-3838</a>.  This can get quite<br>
&gt; complicated for a feature that gives marginal performance increases<br>
&gt; (especially given that this value may never have been read recently -<br>
&gt; at least normal L1 usage guarantees this).<br>
&gt;<br>
&gt; My first suggestion is instead to deprecate the L1OnRehash<br>
&gt; configuration option and to remove this logic.<br>
<br>
</div>+1<br></blockquote><div><br></div><div>+1 from me as well<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
&gt; My second suggestion is a new implementation of L1OnRehash that is<br>
&gt; always enabled when L1 threshold is configured to 0.  For those not<br>
&gt; familiar L1 threshold controls whether invalidations are broadcasted<br>
&gt; instead of individual messages.  A value of 0 means to always<br>
&gt; broadcast.  This would allow for some benefits that we can&#39;t currently<br>
&gt; do:<br>
&gt;<br>
&gt; 1. L1 values would never have to be invalidated on a rehash event<br>
&gt; (guarantee locality reads under rehash)<br>
&gt; 2. L1 requestors would not have to be tracked any longer<br>
&gt;<br>
&gt; However every write would be required to send an invalidation which<br>
&gt; could slow write performance in additional cases (since we currently<br>
&gt; only send invalidations when requestors are found).  The difference<br>
&gt; would be lessened with udp, which is the transport I would assume<br>
&gt; someone would use when configuring L1 threshold to 0.<br>
<br>
</div>Sounds good to me, but I think you could go even beyond this and maybe get rid of threshold configuration option too?<br>
<br>
If the transport is UDP and multicast is configured, invalidations are broadcasted (and apply the two benefits you mention).<br>
If UDP w/ unicast or TCP used, track invalidations and send them as unicasts.<br>
<br>
Do we really need to expose these configuration options to the user?<br></blockquote><div><br></div><div>I think the idea was that even with UDP, sending 2 unicasts and waiting for only 2 responses may be faster than sending a multicast and waiting for 10 responses. However, I&#39;m not sure that&#39;s the case if we send 1 unicast invalidation from each owner instead of a single multicast invalidation from the primary owner/originator [1]. Maybe if each owner would return a list of requestors and the originator would do the invalidation at the end...<br>

</div><div><br>One tangible benefit of having the setting is that we can run the test suite with TCP only, and still cover every path in L1Manager. If removed it completely, it would still be possible to change the toggle in L1ManagerImpl via reflection, but it would be a little hacky.<br>

</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
&gt; What do you guys think?  I am thinking that no one minds the removal<br>
&gt; of L1OnRehash that we have currently (if so let me know).  I am quite<br>
&gt; curious what others think about the changes for L1 threshold value of<br>
&gt; 0, maybe this configuration value is never used?<br>
&gt;<br></div></blockquote><div><br></div><div>Since we don&#39;t give any guidance as to what a good threshold value would be, I doubt many people use it.<br><br></div><div>My alternative proposal would be to replace the invalidationThreshold=-1|0|&gt;0 setting with a traceRequestors=true|false setting.<br>

</div><div>1. If traceRequestors == false, don&#39;t keep track of requestors, only send the invalidation from the originator, and enable l1OnRehash.<br></div><div>    This means we can keep the entries that are in L1 after a rehash as well.<br>

</div><div>2. If traceRequestors == true, track requestors, send unicast/multicast invalidations depending on the transport, and disable l1OnRehash.<br></div><div><br></div><br></div>[1] <a href="https://issues.jboss.org/browse/ISPN-186">https://issues.jboss.org/browse/ISPN-186</a><br>

<br></div><div class="gmail_extra">Cheers<br></div><div class="gmail_extra">Dan<br><br></div></div>