-
1. Re: Infinispan rehash problem
vblagojevic Oct 12, 2010 1:46 PM (in response to liliyancn)Richard,
Can you attach your configuration file and bigger snippet of this loop code?
Regards,
Vladimir
-
2. Re: Infinispan rehash problem
liliyancn Oct 14, 2010 4:28 AM (in response to vblagojevic)Infinispan Configuration :
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:infinispan:config:4.0">
<global>
<!--
use chn-cluster for changbai, ana-cluster for annapurna
-->
<transport
transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"
clusterName="iptv-cluster">
<!--
use udp.xml for now
-->
<properties>
<property name="configurationFile" value="stacks/udp.xml" />
</properties>
</transport>
</global><default>
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="30000" useLockStriping="false"/>
<lazyDeserialization enabled="true"/>
</default><namedCache name="cache_nojta_sync">
<clustering mode="d">
<l1 enabled="false"/>
<hash numOwners="3"/>
<sync/>
</clustering>
</namedCache></infinispan>
-
3. Re: Infinispan rehash problem
liliyancn Oct 14, 2010 4:48 AM (in response to vblagojevic)Inject objects into cache code :
public String getKey(boolean isSmallObject, String prefix, int number) {
String key = "";
if (isSmallObject) {
key = "S<" + number + "|" + prefix + "|" + (number*3) + "|" + (number*7) + ">";
} else {
key = "B[" + number + "|" + prefix + "|" + (number*3) + "|" + (number*7) + "]";
}
return key;
}
Context context = new InitialContext();
DefaultCacheManager cacheManager = (DefaultCacheManager)context.lookup("java:CacheManager");
Cache cache = cacheManager.getCache("cache_nojta_sync");
for(int i = startNum; i <= endNum; i++) {
SmallObject obj = new SmallObject();
obj.setName(getKey(isSmallObject, prefix, i));
obj.setValue("ABC");
cache.put(obj.getName(), obj);
}
Loop back objects code :
Context context = new InitialContext();
DefaultCacheManager cacheManager = (DefaultCacheManager)context.lookup("java:CacheManager");
Cache cache = cacheManager.getCache("cache_nojta_sync");
int count = 0;
for (int i = from ; i <= to; i++) {
String key = getKey(isSmallObject, prefix, i);
SmallObject obj = (SmallObject)cache.get(key);
if(obj != null) {
count++;
}
}
return count;
-
4. Re: Infinispan rehash problem
vblagojevic Oct 14, 2010 1:29 PM (in response to liliyancn)Richard,
I do not understand how you "And I continue trying, after 2 minutes and 21 seconds, I can loop back 8862 objects." How do you "continue trying" ? You can send code example directly to me and I'll have a look.
Regards,
Vladimir
-
5. Re: Infinispan rehash problem
mircea.markus Oct 14, 2010 4:10 PM (in response to liliyancn)This is related to https://jira.jboss.org/browse/ISPN-654 - I've tried to reproduce this a lot, but I was looking at the wrong thing!
Please confirm that this would be the expected behaviour:
- if a node craches and you read all the keys you added to the cluster immediately after, from another node then either
a) all the values are returned successfully or b) a TimeoutException is thrown at some point when reading if the given key was not transfered
What should never happen is to return null from a key that is in cache - that is incorrect.
-
6. Re: Infinispan rehash problem
vblagojevic Oct 14, 2010 6:16 PM (in response to mircea.markus)I looked around the code and I believe that this issue could have been potentially fixed in 4.2 Alpha3. Why don't you give it a try Richard?
-
7. Re: Infinispan rehash problem
liliyancn Oct 15, 2010 3:14 AM (in response to vblagojevic)"continue trying" means "put objects into cache" and "loop back objects from cache" are put into two webservcies respectively. So, I actually use SoapUI to PUT objects once and LOOP them repeatly.
As your suggestion, I will test this issue by 4.2 Alpha3, wish have a good result.
-
8. Re: Infinispan rehash problem
mircea.markus Nov 10, 2010 12:58 PM (in response to liliyancn)This is now fixed: https://jira.jboss.org/browse/ISPN-654