Reinitialize cluster with CacheStore
suenda Apr 10, 2017 12:31 PMWe are using a cluster of infinispan nodes (v8.2.1 embedded inside a tomcat container) configured with jdbc-store persistence in synchronised mode. The nodes write well to the database when we put the data into the cache. We want to be able to restart our cluster and initialize it with the data from the persistence. When we restart the cluster with the persistence containing data, it seems the nodes do not actually fetch data into the memory when restarted, the JMX metrics of the cache show 0 entries. However, on querying the cache, it does return the data fetched from the persistence. On the other hand, after invoking several Cache.values(), the node becomes unresponsive and as a result requires a whole cluster restart (only when the cluster is started with persistence containing data).
Besides, we have also noticed a big latency in response time of Cache.values() when the cluster is configured with persistence compared to the one without (20 seconds vs 3 sec for 10k objects (20 MB) in a cluster of three nodes).
the config :
<?xml version="1.0" encoding="UTF-8"?>
<infinispan>
<jgroups>
<stack-file name="tcp2" path="jgroups.xml"/>
</jgroups>
<cache-container default-cache="dist-default" name="CacheContainer" statistics="true">
<transport cluster="My_Cluster" stack="tcp2" />
<distributed-cache
name="dist-default"
mode="SYNC"
segments="60"
owners="2"
l1-lifespan="300000"
l1-cleanup-interval="60000"
remote-timeout="15000"
statistics="true"
>
<state-transfer enabled="true"
timeout="240000"
await-initial-transfer="true"/>
<persistence>
<string-keyed-jdbc-store
fetch-state="false"
read-only="false"
purge="false"
shared="true"
key-to-string-mapper="com.example.mapper.UUID2StringTwoWayMapper">
<connection-pool
connection-url="jdbc:h2:tcp://h2host:9092/D:/temp/infinispan-persistence"
username="" driver="org.h2.Driver" />
<string-keyed-table
drop-on-exit="false"
create-on-start="true"
prefix="ISPN">
<id-column name="KEY" type="VARCHAR(36)" />
<data-column name="VALUE" type="BINARY" />
<timestamp-column name="TIMESTAMP" type="BIGINT" />
</string-keyed-table>
</string-keyed-jdbc-store>
</persistence>
<partition-handling enabled="true"/>
</distributed-cache>
</cache-container>
</infinispan>
Thanks in advance for any hint we could use to fix this issue.