<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Mar 1, 2018 at 11:21 AM William Burns &lt;<a href="mailto:mudokonman@gmail.com">mudokonman@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Mar 1, 2018 at 11:14 AM Thomas SEGISMONT &lt;<a href="mailto:tsegismont@gmail.com" target="_blank">tsegismont@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2018-03-01 16:36 GMT+01:00 Tristan Tarrant <span dir="ltr">&lt;<a href="mailto:ttarrant@redhat.com" target="_blank">ttarrant@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You need to use the brand new CacheAdmin API:<br>
<br>
<a href="http://infinispan.org/docs/stable/user_guide/user_guide.html#obtaining_caches" rel="noreferrer" target="_blank">http://infinispan.org/docs/stable/user_guide/user_guide.html#obtaining_caches</a></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I&#39;ll look into that for Vert.x 3.6 which will be based on Infinispan 9.2.<br><br></div>Is there any way to achieve these goals with 9.1.x?</div></div></div></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>You could try using the ClusterExecutor to invoke getCache across all nodes. Note it has to return null since a Cache is not Serializable.</div><div><br></div></div></div></blockquote><div> </div><div>Fixed typo below, sorry </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div></div><div>String cacheName = ;</div><div><div>cache.getCacheManager().executor().submitConsumer(cm -&gt; {</div><div>         cm.getCache(cacheName);</div><div>         return null;</div><div>      }, (a, v, t) -&gt; {</div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><div>            if (t != null) {</div><div>               System.out.println(&quot;There was an exception &quot; + t + &quot; retrieving &quot; + cacheName + &quot; from node: &quot; + a);</div><div>            }</div><div>         }</div><div>      );</div></div></div></div><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
<br>
Tristan<br>
<div><div class="m_-6042644179097204182m_-3952894493400500524h5"><br>
On 3/1/18 4:30 PM, Thomas SEGISMONT wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; This email follows up on my testing of the Infinispan Cluster Manager<br>
&gt; for Vert.x on Kubernetes.<br>
&gt;<br>
&gt; In one of the tests, we want to make sure that, after a rolling update<br>
&gt; of the application, the data submitted to Vert.x&#39; AsyncMap is still<br>
&gt; present. And I found that when the underlying cache is predefined in<br>
&gt; infinispan.xml, the data is present, otherwise it&#39;s not.<br>
&gt;<br>
&gt; I pushed a simple reproducer on GitHub:<br>
&gt; <a href="https://github.com/tsegismont/cachedataloss" rel="noreferrer" target="_blank">https://github.com/tsegismont/cachedataloss</a><br>
&gt;<br>
&gt; The code does this:<br>
&gt; - a first node is started, and creates data<br>
&gt; - new nodes are started, but they don&#39;t invoke cacheManager.getCache<br>
&gt; - the initial member is killed<br>
&gt; - a &quot;testing&quot; member is started, printing out the data in the console<br>
&gt;<br>
&gt; Here are my findings.<br>
&gt;<br>
&gt; 1/ Even when caches are declared in infinispan.xml, the data is lost<br>
&gt; after the initial member goes away.<br>
&gt;<br>
&gt; A little digging showed that the caches are really distributed only<br>
&gt; after you invoke cacheManager.getCache<br>
&gt;<br>
&gt; 2/ Checking cluster status &quot;starts&quot; triggers distribution<br>
&gt;<br>
&gt; I was wondering why the behavior was not the same as with my Vert.x<br>
&gt; testing on Openshift. And then realized the only difference was the<br>
&gt; cluster readiness check, which reads the cluster health. So I updated<br>
&gt; the reproducer code to add such a check (still without invoking<br>
&gt; cacheManager.getCache). Then the caches defined in infinispan.xml have<br>
&gt; their data distributed.<br>
&gt;<br>
&gt; So,<br>
&gt;<br>
&gt; 1/ How can I make sure caches are distributed on all nodes, even if some<br>
&gt; nodes never try to get a reference with cacheManager.getCache, or don&#39;t<br>
&gt; check cluster health?<br>
&gt; 2/ Are we doing something wrong with our way to declare the default<br>
&gt; configuration for caches [1][2]?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Thomas<br>
&gt;<br>
&gt; [1]<br>
&gt; <a href="https://github.com/tsegismont/cachedataloss/blob/master/src/main/resources/infinispan.xml#L10" rel="noreferrer" target="_blank">https://github.com/tsegismont/cachedataloss/blob/master/src/main/resources/infinispan.xml#L10</a><br>
&gt; [2]<br>
&gt; <a href="https://github.com/tsegismont/cachedataloss/blob/master/src/main/resources/infinispan.xml#L22" rel="noreferrer" target="_blank">https://github.com/tsegismont/cachedataloss/blob/master/src/main/resources/infinispan.xml#L22</a><br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
<span class="m_-6042644179097204182m_-3952894493400500524HOEnZb"><font color="#888888"><br>
--<br>
Tristan Tarrant<br>
Infinispan Lead and Data Grid Architect<br>
JBoss, a division of Red Hat<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</font></span></blockquote></div></div></div>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></blockquote></div></div></blockquote></div></div>