<div class="gmail_quote">On Mon, Oct 1, 2012 at 12:48 PM, Galder Zamarreņo <span dir="ltr"><<a href="mailto:galder@redhat.com" target="_blank">galder@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
On Sep 24, 2012, at 5:22 PM, Dan Berindei <<a href="mailto:dan.berindei@gmail.com">dan.berindei@gmail.com</a>> wrote:<br>
<br>
> Hi guys<br>
><br>
> During the final push for NBST I found a bug with preloading (entries that didn't belong on a joiner weren't removed after the initial state transfer). I decided to fix it and <a href="https://issues.jboss.org/browse/ISPN-1586" target="_blank">https://issues.jboss.org/browse/ISPN-1586</a> at the same time, since it was a longstanding bug and I had a reasonable idea on what to do. However, I missed some implications and I need to fix them - there is at least one Query test failing because of my change (SharedCacheLoaderQueryIndexTest).<br>
><br>
> In 5.1, preloading worked like this:<br>
> 1. Start the CacheLoaderManager, which preloads everything from the cache store in memory.<br>
> 2. Start the StateTransferManager, retrieving data from the other cache members and overwriting already-preloaded values.<br>
> 3. When the initial state transfer ends, entries not owned by the local node are deleted.<br>
><br>
> The main issue with this, raised in ISPN-1586, is that entries that were deleted on the other cache members are "revived" on the joiner when it reads the data from the cache store. There is another performance issue, because we load a lot of data that we then discard, but that's less important.<br>
><br>
> With the ISPN-1586 fix, preloading should work like this:<br>
> 1. Start the StateTransferManager, receive initial CH.<br>
> 2. If the local node is not the first to start up, fetching state (either in-memory or persistent) is enabled and the cache store is non-shared, clear it.<br>
> 3. Start the CacheLoaderManager, which preloads the cache store in memory - but only if the local node is the first one having started the cache OR if the fetching state is disabled.<br>
> 4. Run the initial state transfer, retrieving data from the other cache members (if any, and if fetching state is enabled).<br>
><br>
> This solves ISPN-1586, but it does mean that data from non-shared cache stores will be lost on all the nodes except the first that starts up. So if the last node to shut down is not the first node to start back up, the cluster will lose data.<br>
><br>
> These are the alternatives I'm considering:<br>
> a) Finish the ISPN-1586 fix and clearly document that non-shared cache stores don't guarantee persistence after cluster restart (unless the last cache to stop is the first to start back up and shutdown was spaced out to allow state transfer to move everything to the last node).<br>
<br>
</div>^ What if the whole cluster goes down for other reasons? The in-memory state would be gone, but having these non-shared cache stores should provide with the opportunity to recover.<br>
<br>
If this is implemented, this option would be gone and partial state would be lost. That's not good.<br>
<div class="im"><br></div></blockquote><div><br>Good point Galder... unfortunately, we can't tell at the moment if the whole cluster was shut down (and the state on the joiner is up-to-date, maybe even essential) or if only the joiner was shut down, and its state is stale.<br>
<br>In the spirit of my JMX proposal, maybe we could leave preloading enabled by default but add a cluster-wide "stop preloading" flag that the admin can set once the cluster has finished starting?<br><br> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> b) Revert my ISPN-1586 fix and allow "zombie" cache entries on the joiners (leaving ISPN-1586 open).<br>
><br>
> I think there may be a third option:<br>
> c) Make preload a JMX operation and allow the user to run a cluster-wide preload once all the nodes in the cluster have started up. But this looks a little complicated, and it would require either versioning or prohibiting external cache writes until the cluster-wide preload is done to ensure consistency.<br>
><br>
> What do you guys think? Sanne, I'm particularly interested how you think option a) would fit with the query module.<br>
><br>
> Cheers<br>
> Dan<br>
><br>
</div><div class="im">> _______________________________________________<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>
<br>
<br>
--<br>
</div>Galder Zamarreņo<br>
<a href="mailto:galder@redhat.com">galder@redhat.com</a><br>
<a href="http://twitter.com/galderz" target="_blank">twitter.com/galderz</a><br>
<br>
Project Lead, Escalante<br>
<a href="http://escalante.io" target="_blank">http://escalante.io</a><br>
<br>
Engineer, Infinispan<br>
<a href="http://infinispan.org" target="_blank">http://infinispan.org</a><br>
<div class="HOEnZb"><div class="h5"><br>
<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>