Infinispan disaster recovery/durability
cbeer Mar 7, 2013 9:15 PMHi all,
I have some basic questions to help get my head about how Infinispan handles persistence in several disaster recovery scenarios. Before setting out to derive the answer empirically, I thought I'd go to the source. We're using Modeshape and storing all of our content in Infinispan. We want to ensure our content is as durable as possible, by using clustering, cache chaining, etc. I think I have a grasp on clustering, so these questions about mainly about using multiple cache loaders.
First, we've configured our loaders with passivation false (this ensure content is stored not only in RAM, but also in one (or all) of the loaders?)
<loaders passivation="false" shared="false" preload="false">
And then we have two FileCacheStore instances, in this case, pointing to two different directories:
<loader class="org.infinispan.loaders.file.FileCacheStore" purgeOnStartup="false">
<properties>
<!-- We have to set the location where we want to store the data. -->
<property name="location" value="/path/a"/>
<property name="fsyncMode" value="perWrite"/>
</properties>
</loader>
<loader class="org.infinispan.loaders.file.FileCacheStore" purgeOnStartup="false">
<properties>
<!-- We have to set the location where we want to store the data. -->
<property name="location" value="/path/b"/>
<property name="fsyncMode" value="perWrite"/>
</properties>
</loader>
So, in a terrible disaster, we lose the content in /path/b. Is there anything we need to do to repopulate the 2nd cache loader?
Now we lose the content in /path/a. Is there anything we need to do to repopulate the 1st cache loader?
I'm also interested in the behavior of fetchPersistentState on either of the cache loaders (which, I confess, I barely grasp right now.) I believe in this case, it doesn't really matter which cache loader we set fetchPersistentState on, right?
Now, instead of two different FileCacheStores, we decide to write our own CacheStore that persists content to, say, Amazon Glacier, where storage is relatively cheap but retrieval will take quite some time. In that case, I assume we'd want to set fetchPersistentState on the FileCacheStore, and transfer to the other store using <async>? Now, when we use <async>, we'd like a way to check if the content was actually successfully stored at some future point in time (because we're paranoid). It sounds like we'll have to reach deep into Infinispan to get a handle to the cache store and check ourselves, right?
Finally, let's say we run out of room on our spinning disk, but our Glacier cache store is "infinitely" deep. Does Infinispan provide a mechanism (similar to eviction, I guess) to remove content from a cache store (on the assumption that it's in a different cache store)? Or would we have to roll-our-own?
Thanks,
Chris