<div dir="ltr">Mircea, I think I&#39;m missing something here. Why would the originator send a TxCompletionNotificationCommand at all if the commit command was asynchronous?<br><br><div class="gmail_extra">I don&#39;t think recovery should require the originator to send a TxCompletionNotificationCommand. Our commit commands can&#39;t fail anyway, so the only way for a transaction to become in-doubt would be if the cache crashed before sending the command. (Or maybe if another resource&#39;s commit phase failed.)<br>

<br></div><div class="gmail_extra">Cheers<br></div><div class="gmail_extra">Dan<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 15, 2013 at 5:06 PM, Mircea Markus <span dir="ltr">&lt;<a href="mailto:mmarkus@redhat.com" target="_blank">mmarkus@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">Thanks again for nice explanation Jonathan!<br>
@Pedro - seems like you&#39;re doing the right thing by encouraging people to be properly paranoid :-)<br>
Otherwise we&#39;d leak tx logs (in infinispan parlance the PrepareCommands in the recovery cache) which would not be nice.<br>
<div class="HOEnZb"><div class="h5"><br>
On 15 May 2013, at 13:32, Jonathan Halliday &lt;<a href="mailto:jonathan.halliday@redhat.com">jonathan.halliday@redhat.com</a>&gt; wrote:<br>
<br>
&gt;<br>
&gt; No, it&#39;s out of scope for the TM, at least as far as the JTA/XA specs<br>
&gt; are concerned. The TM would not retain any txlog information to allow it<br>
&gt; to perform useful recovery anyhow.   Usually you just log it in the hope<br>
&gt; a human notices and sorts out the mess.  Of course properly paranoid<br>
&gt; humans don&#39;t use async commit in the first place.<br>
&gt;<br>
&gt; There has been various talk around making JTA TM.commit() support an<br>
&gt; async callback, such that the business logic thread can continue as soon<br>
&gt; as the prepare phase is successful, whilst still receiving a callback<br>
&gt; handler invocation if the commit phase subsequently fails. Extending<br>
&gt; that to the XA protocol would be nice, but won&#39;t happen as there is no<br>
&gt; upward (RM-&gt;TM) communication in XA - it&#39;s all driven top down.  So as<br>
&gt; you point out, adding the failed tx to the in-doubt list is the only way<br>
&gt; of signalling a problem. That&#39;s bad, since you&#39;d also need a positive<br>
&gt; &#39;it worked&#39; callback in the proto to allow GC of the txlog, otherwise<br>
&gt; you have to throw away the log eagerly and can&#39;t then do anything useful<br>
&gt; with the subsequent error callback anyhow.<br>
&gt;<br>
&gt; Associated with that discussion is the expectation around the semantics<br>
&gt; of afterCompletion, which may mean &#39;after successful prepare&#39; or &#39;after<br>
&gt; successful commit&#39; in such case, the latter effectively removing the<br>
&gt; need for a new JTA callback api in the first place.<br>
&gt;<br>
&gt; If you don&#39;t need a callback at all, then there is already an async<br>
&gt; commit option in the TM config, it&#39;s just non-standard and marginally<br>
&gt; dangerous. It simply logs commit phase failures and hopes a human notices.<br>
&gt;<br>
&gt; Jonathan.<br>
&gt;<br>
&gt; On 05/15/2013 01:13 PM, Mircea Markus wrote:<br>
&gt;&gt; Hi Jonathan,<br>
&gt;&gt;<br>
&gt;&gt; In the scope of ISPN-3063 [1] we came to a problem we need some advice on :-)<br>
&gt;&gt;<br>
&gt;&gt; Would a transaction manager expect/handle this situation: for a transaction the commit is successful but at a further point the same transaction would be reported as &quot;in-doubt&quot; to the recovery process. In our case this can happen when we send the commit async and this might only fail after the commit is acknowledged to the TM.<br>


&gt;&gt;<br>
&gt;&gt; [1] <a href="https://issues.jboss.org/browse/ISPN-3063" target="_blank">https://issues.jboss.org/browse/ISPN-3063</a><br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Registered in England and Wales under Company Registration No. 03798903<br>
&gt; Directors: Michael Cunningham (USA), Mark Hegarty (Ireland), Matt Parson<br>
&gt; (USA), Charlie Peters (USA)<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>
</div></div><div class="im HOEnZb">Cheers,<br>
--<br>
Mircea Markus<br>
Infinispan lead (<a href="http://www.infinispan.org" target="_blank">www.infinispan.org</a>)<br>
<br>
<br>
<br>
<br>
<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<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>