-
1. Re: CacheLoader at cache startup
mgencur Jun 29, 2012 10:38 AM (in response to ferwasy)Hi Fernando,
feel free to look at https://github.com/infinispan/infinispan/blob/master/core/src/test/java/org/infinispan/distribution/PessimisticDistSyncTxCacheStoreSharedTest.java and play with it. You'll find out the entries that were in the first node and its underlying cache store are redistributed after the new node joins the cluster. There should not be duplicated records when numOwners=1. The parameter called fetchPersistentState also plays its role here.
-
2. Re: CacheLoader at cache startup
ferwasy Jul 10, 2012 3:17 PM (in response to mgencur)Martin: if the cache stored is shared among all nodes/instances, all nodes load all the entries at startup. I have tested this by starting 3 nodes in (aprox) the same time. No info about the replicated/distribution modes is taken into account in the process of preload entries (CacheLoadManagerImpl.preload()). I am using the 5.1.x version obtained from the branch in git.
Regards.
Fernando.
-
3. Re: CacheLoader at cache startup
mgencur Jul 11, 2012 2:50 AM (in response to ferwasy)Fernando,
this is strange. I modified the test above (https://github.com/mgencur/infinispan/commit/c8025e10982dde257e5919e0aecf58bb24e18959) and when I run it, I get output similar to:
Size1:1
Size2:3
Size1:2
Size2:6
Other times I get this:
Size1:2
Size2:2
Size1:4
Size2:4
or
Size1:3
Size2:1
Size1:4
Size2:4
It is a distributed mode so the distribution depends on a hash-wheel algorithm. Can you provide a test that proves your theses? e.g. similar to the above one
-
4. Re: CacheLoader at cache startup
ferwasy Aug 14, 2012 4:17 PM (in response to mgencur)Martin: there is no need for the test. If you have a shared cache loader with preload=true, CacheLoaderManagerImpl preloads all entries. I think this should be different in case "distribution" mode is selected. Maybe preload entries based on the consistent hash? (only those which are owned by the node)?
-
5. Re: CacheLoader at cache startup
ferwasy Aug 14, 2012 4:21 PM (in response to mgencur)For more info, this is the relevant parts of my configuration.
<clustering mode="distribution">
<hash numOwners="1"/>
<sync />
<stateTransfer fetchInMemoryState="true"/>
</clustering>
<loaders passivation="false" shared="true" preload="true">
<loader class="org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStore"
fetchPersistentState="false" ignoreModifications="false"
purgeOnStartup="false">
Using Infinispan 5.1.5