<div dir="ltr">Comments inline<div><br></div><div>To be honest it might be easier to talk on IRC sometime since I am not sure the exact part you are trying to work on now. I am guessing you are reusing the ClusterStreamManager and LocalStreamManager parts and adapting as needed but I don&#39;t know for sure.<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 10, 2017 at 6:41 AM Radim Vansa &lt;<a href="mailto:rvansa@redhat.com">rvansa@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Will,<br class="gmail_msg">
<br class="gmail_msg">
rebasing scattered cache PR I&#39;ve found a test failure when handling<br class="gmail_msg">
streams, and I&#39;d like to ask you guidance, how to address it.<br class="gmail_msg">
<br class="gmail_msg">
My problem is that temporarily primary owners can be unknown (when a<br class="gmail_msg">
node crashes), but streams assume that there&#39;s always a primary owner.<br class="gmail_msg">
Therefore, a remote streams operation must be delayed until a topology<br class="gmail_msg">
arrives where the new owner is decided.<br class="gmail_msg"></blockquote><div><br></div><div>One thing to reduce this is if a node was primary there is a special exception. If this node becomes a backup owner after being primary this is fine. The segment is only suspected if it loses ownership completely.</div><div><br></div><div>There is no waiting currently it will submit the request again until it eventually gets what it wants. (this could be improved) There is a wait though when the originator has a newer topology if a remote node doesn&#39;t yet have the updated topology (StreamRequestCommand implements TopologyAffectedCommand).</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
Could you suggest how should I adapt the code?<br class="gmail_msg"></blockquote><div><br></div><div>The ClusterStreamManager only does one invocation and stores the results from that invocation. The caller then has to adapt the next call with the segments it still needs and call back into the ClusterStreamManager if needed (segments could be owned locally now).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ClusteredStreamManagerImpl currently does not hold DistributionManager<br class="gmail_msg">
reference, ConsistenHash is passed down from DistributedCacheStream, and<br class="gmail_msg">
it seems that segments are suspected after any unsuccessful response.<br class="gmail_msg">
Which components should react to topology changes?<br class="gmail_msg"></blockquote><div><br></div><div>The only component currently that reacts to topology change is in the LocalStreamManagerImpl which registers a listener to detect when a segment is lost. This is done on remote nodes only. When this segment is lost it will send that those segments weren&#39;t completed back to the requester (ClusterStreamManager) on its next response.</div><div><br></div><div>As you mentioned any unsuccessful response is treated as suspected, since we can&#39;t really trust that node, so there is no code on originator required to listen for topology changes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
Thanks!<br class="gmail_msg">
<br class="gmail_msg">
Radim<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Radim Vansa &lt;<a href="mailto:rvansa@redhat.com" class="gmail_msg" target="_blank">rvansa@redhat.com</a>&gt;<br class="gmail_msg">
JBoss Performance Team<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
infinispan-dev mailing list<br class="gmail_msg">
<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
</blockquote></div></div></div>