<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 6, 2014 at 6:19 PM, Bela Ban <span dir="ltr">&lt;<a href="mailto:bban@redhat.com" target="_blank">bban@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hey Dan,<br>
<div class=""><br>
On 06/08/14 16:13, Dan Berindei wrote:<br>
&gt; I could create the issue in JIRA, but I wouldn&#39;t make it high priority<br>
&gt; because I think it have lots of corner cases with NBST and cause<br>
&gt; headaches for the maintainers of state transfer ;)<br>
<br>
</div>I do believe the put-while-holding-the-lock issue *is* a critical issue;<br>
anyone banging a cluster of Infinispan nodes with more than 1 thread<br>
will run into lock timeouts, with or without transactions. The only<br>
workaround for now is to use total order, but at the cost of reduced<br>
performance. However, once a system starts hitting the lock timeout<br>
issues, performance drops to a crawl, way slower than TO, and work<br>
starts to pile up, which compounds the problem.<br></blockquote><div><br></div><div>I wouldn&#39;t call it critical because you can always increase the number of threads. It won&#39;t be pretty, but it will work around the thread exhaustion issue.</div>

<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
I believe doing a sync RPC while holding the lock on a key is asking for<br>
trouble and is (IMO) an anti-pattern.<br></blockquote><div><br></div><div>We also hold a lock on a key between the LockControlCommand and the TxCompletionNotificationCommand in pessimistic-locking caches, and there&#39;s at least one sync PrepareCommand RPC between them...</div>

<div><br></div><div>So I don&#39;t see it as an anti-pattern, the only problem is that we should be able to do that without blocking internal threads in addition to the user thread (which is how tx caches do it).</div><div>

<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Sorry if this has a negative impact on NBST, but should we not fix this<br>
because we don&#39;t want to risk a change to NBST ?<br></blockquote><div><br></div><div>I&#39;m not saying it will have a negative impact on NBST, I&#39;m just saying I don&#39;t want to start implementing an incomplete proposal for the basic flow and leave the state transfer/topology change issues for &quot;later&quot;. When happens when a node leaves, when a backup owner is added, or when the primary owner changes should be part of the initial discussion, not an afterthought.</div>

<div><br></div><div>E.g. with your proposal, any updates in the replication queue on the primary owner will be lost when that primary owner dies, even though we told the user that we successfully updated the key. To quote from my first email on this thread: &quot;<span style="font-family:arial,sans-serif;font-size:13px">OTOH, if the primary owner dies, we have to ask a backup, and we can lose the modifications not yet replicated by the primary.&quot;</span></div>

<div><br></div><div>With Sanne&#39;s proposal, we wouldn&#39;t report to the user that we stored the value until all the backups confirmed the update, so we wouldn&#39;t have that problem. But I don&#39;t see how we could keep the sequence of versions monotonous when the primary owner of the key changes without some extra sync RPCs (also done while holding the key lock). IIRC TOA also needs some sync RPCs to generate its sequence numbers.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><br>
&gt; Besides, I&#39;m still not sure I understood your proposals properly, e.g.<br>
&gt; whether they are meant only for non-tx caches or you want to change<br>
&gt; something for tx caches as well...<br>
<br>
</div>I think this can be used for both cases; however, I think either Sanne&#39;s<br>
solution of using seqnos *per key* and updating in the order of seqnos<br>
or using Pedro&#39;s total order impl are probably better solutions.<br>
<br>
I&#39;m not pretending these solutions are final (e.g. Sanne&#39;s solution<br>
needs more thought when multiple keys are involved), but we should at<br>
least acknowledge the issue exists, create a JIRA to prioritize it and<br>
then start discussing solutions.<br>
<div class="im"><br></div></blockquote><div><br></div><div>We&#39;ve been discussing solutions without a JIRA just fine :)</div><div><br></div><div>My feeling so far is that the thread exhaustion problem would be better served by porting TO to non-tx caches and/or changing non-tx locking to not require a thread. I have created an issue for TO [1], but IMO the locking rework [2] should be higher priority, as it can help both tx and non-tx caches.</div>

<div><br></div><div>[1] <a href="https://issues.jboss.org/browse/ISPN-4610">https://issues.jboss.org/browse/ISPN-4610</a><br></div><div>[2] <a href="https://issues.jboss.org/browse/ISPN-2849">https://issues.jboss.org/browse/ISPN-2849</a><br>

</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">&gt;<br>
&gt;<br>
&gt; On Wed, Aug 6, 2014 at 1:02 PM, Bela Ban &lt;<a href="mailto:bban@redhat.com">bban@redhat.com</a><br>
</div><div class=""><div class="h5">&gt; &lt;mailto:<a href="mailto:bban@redhat.com">bban@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Seems like this discussion has died with the general agreement that this<br>
&gt;     is broken and with a few proposals on how to fix it, but without any<br>
&gt;     follow-up action items.<br>
&gt;<br>
&gt;     I think we (= someone from the ISPN team) need to create a JIRA,<br>
&gt;     preferably blocking.<br>
&gt;<br>
&gt;     WDYT ?<br>
&gt;<br>
&gt;     If not, here&#39;s what our options are:<br>
&gt;<br>
&gt;     #1 I&#39;ll create a JIRA<br>
&gt;<br>
&gt;     #2 We&#39;ll hold the team meeting in Krasnojarsk, Russia<br>
&gt;<br>
&gt;     #3 There will be only vodka, no beers in #2<br>
&gt;<br>
&gt;     #4 Bela will join the ISPN team<br>
&gt;<br>
&gt;     Thoughts ?<br>
<br>
<br>
--<br>
Bela Ban, JGroups lead (<a href="http://www.jgroups.org" target="_blank">http://www.jgroups.org</a>)<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>