Author: manik.surtani(a)jboss.com
Date: 2008-01-30 10:38:36 -0500 (Wed, 30 Jan 2008)
New Revision: 5259
Added:
core/trunk/src/test/java/org/jboss/cache/replicated/ReplicationQueueTest.java
Removed:
core/trunk/src/test/resources/META-INF/pess-repl-async-issue.xml
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java
Log:
JBCACHE-1280 - replication queue messages fail on remote node
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java 2008-01-29
18:53:19 UTC (rev 5258)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java 2008-01-30
15:38:36 UTC (rev 5259)
@@ -129,7 +129,7 @@
*/
public void _replicate(List<MethodCall> methodCalls) throws Throwable
{
- for (MethodCall methodCall : methodCalls) _replicate(methodCall);
+ for (MethodCall methodCall : methodCalls) _replicate((MethodCall)
methodCall.getArgs()[0]);
}
public void block()
Copied: core/trunk/src/test/java/org/jboss/cache/replicated/ReplicationQueueTest.java
(from rev 5258,
core/trunk/src/test/java/org/jboss/cache/AsyncReplicationQueusFailureTest.java)
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/replicated/ReplicationQueueTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/replicated/ReplicationQueueTest.java 2008-01-30
15:38:36 UTC (rev 5259)
@@ -0,0 +1,50 @@
+package org.jboss.cache.replicated;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.misc.TestingUtil;
+import static org.testng.AssertJUnit.assertNotNull;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+@Test(groups = "functional")
+public class ReplicationQueueTest
+{
+ private static final int COUNT = 10;
+ private static final String CONFIG_FILE =
"META-INF/pess-repl-async-issue.xml";
+ Cache cache, cache2;
+
+ @BeforeMethod
+ public void setUp() throws CloneNotSupportedException
+ {
+ cache = new DefaultCacheFactory().createCache(false);
+ cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
+ cache.getConfiguration().setUseReplQueue(true);
+ cache.getConfiguration().setReplQueueMaxElements(COUNT);
+ cache.start();
+
+ cache2 = new DefaultCacheFactory().createCache(cache.getConfiguration().clone());
+
+ TestingUtil.blockUntilViewsReceived(60000, cache, cache2);
+ }
+
+ @AfterMethod
+ public void tearDown()
+ {
+ TestingUtil.killCaches(cache, cache2);
+ }
+
+ public void testFailure() throws InterruptedException
+ {
+ for (int i = 0; i < COUNT; i++)
+ {
+ System.out.println("on put i = " + i);
+ cache.put("/a/b/c" + i, "key", "value");
+ assertNotNull(cache.get("/a/b/c" + i, "key"));
+ }
+ Thread.sleep(2000);
+ for (int i = 0; i < COUNT; i++) assertNotNull("on get i = " + i,
cache2.get("/a/b/c" + i, "key"));
+ }
+}
Deleted: core/trunk/src/test/resources/META-INF/pess-repl-async-issue.xml
===================================================================
--- core/trunk/src/test/resources/META-INF/pess-repl-async-issue.xml 2008-01-29 18:53:19
UTC (rev 5258)
+++ core/trunk/src/test/resources/META-INF/pess-repl-async-issue.xml 2008-01-30 15:38:36
UTC (rev 5259)
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
-
- <classpath codebase="./lib" archives="jboss-cache.jar,
jgroups.jar"/>
-
-
- <mbean code="org.jboss.cache.CacheImpl"
- name="jboss.cache:service=TreeCache">
-
- <depends>jboss:service=Naming</depends>
- <depends>jboss:service=TransactionManager</depends>
-
- <attribute
name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup</attribute>
- <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
- <attribute name="CacheMode">REPL_ASYNC</attribute>
- <attribute name="UseReplQueue">true</attribute>
- <attribute name="ReplQueueInterval">0</attribute>
- <attribute name="ReplQueueMaxElements">100</attribute>
- <attribute name="ClusterName">JBossCache-Cluster</attribute>
- <attribute name="ClusterConfig">
- <config>
- <UDP mcast_addr="232.10.10.10"
- mcast_port="45599"
- tos="8"
- ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000"
- mcast_recv_buf_size="25000000"
- mcast_send_buf_size="640000"
- loopback="false"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- ip_ttl="2"
- down_thread="false" up_thread="false"
- enable_bundling="false"/>
- <PING timeout="2000"
- down_thread="false" up_thread="false"
num_initial_members="3"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false"
min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <FD timeout="1000" max_tries="2"
shun="true"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false"
up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <UNICAST timeout="300,600,1200,2400,3600"
- down_thread="false" up_thread="false"/>
- <pbcast.STABLE stability_delay="1000"
desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true"
join_timeout="3000" use_flush="true" flush_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- <FC max_credits="2000000" down_thread="false"
up_thread="false"
- min_threshold="0.20"/>
- <FRAG2 frag_size="60000" down_thread="false"
up_thread="false"/>
- <!-- <pbcast.STREAMING_STATE_TRANSFER down_thread="false"
up_thread="false"
- use_flush="true"
flush_timeout="3000" use_reading_thread="true"/> -->
- <pbcast.STATE_TRANSFER down_thread="false"
up_thread="false" use_flush="true"
flush_timeout="3000"/>
- <pbcast.FLUSH down_thread="false" up_thread="false"
timeout="8000" auto_flush_conf="false"/>
- </config>
- </attribute>
- <attribute name="FetchInMemoryState">false</attribute>
- <attribute
name="InitialStateRetrievalTimeout">15000</attribute>
- <attribute name="SyncReplTimeout">60000</attribute>
- <attribute name="LockAcquisitionTimeout">10000</attribute>
- <attribute name="EvictionPolicyConfig">
- </attribute>
-
- <attribute name="CacheLoaderConfiguration">
- </attribute>
-
- <attribute
name="UseRegionBasedMarshalling">false</attribute>
- </mbean>
-</server>
Show replies by date