JBoss Cache SVN: r7434 - in support/tags/1.5: common and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-09 12:57:00 -0500 (Fri, 09 Jan 2009)
New Revision: 7434
Modified:
support/tags/1.5/common/pom.xml
support/tags/1.5/pom.xml
support/tags/1.5/xslt/pom.xml
Log:
Moved to 1.5
Modified: support/tags/1.5/common/pom.xml
===================================================================
--- support/tags/1.5/common/pom.xml 2009-01-09 17:54:56 UTC (rev 7433)
+++ support/tags/1.5/common/pom.xml 2009-01-09 17:57:00 UTC (rev 7434)
@@ -4,11 +4,11 @@
<parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-support</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.5</version>
</parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-common-parent</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.5</version>
<packaging>pom</packaging>
<name>JBoss Cache Common Parent</name>
<description>The parent POM for all JBoss Cache modules.</description>
Modified: support/tags/1.5/pom.xml
===================================================================
--- support/tags/1.5/pom.xml 2009-01-09 17:54:56 UTC (rev 7433)
+++ support/tags/1.5/pom.xml 2009-01-09 17:57:00 UTC (rev 7434)
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-support</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.5</version>
<packaging>pom</packaging>
<name>JBoss Cache Support Modules</name>
<description>Grouping of JBoss Cache support modules</description>
Modified: support/tags/1.5/xslt/pom.xml
===================================================================
--- support/tags/1.5/xslt/pom.xml 2009-01-09 17:54:56 UTC (rev 7433)
+++ support/tags/1.5/xslt/pom.xml 2009-01-09 17:57:00 UTC (rev 7434)
@@ -6,12 +6,12 @@
<parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-support</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.5</version>
</parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-doc-xslt-support</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.5</version>
<name>JBoss Cache Documentation XSLT support</name>
<description>JBoss Cache Documentation XSLT support</description>
15 years, 4 months
JBoss Cache SVN: r7433 - in support/trunk: common and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-09 12:54:56 -0500 (Fri, 09 Jan 2009)
New Revision: 7433
Modified:
support/trunk/common/pom.xml
support/trunk/pom.xml
support/trunk/xslt/pom.xml
Log:
Incremented version
Modified: support/trunk/common/pom.xml
===================================================================
--- support/trunk/common/pom.xml 2009-01-09 17:51:30 UTC (rev 7432)
+++ support/trunk/common/pom.xml 2009-01-09 17:54:56 UTC (rev 7433)
@@ -4,11 +4,11 @@
<parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-support</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
</parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-common-parent</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JBoss Cache Common Parent</name>
<description>The parent POM for all JBoss Cache modules.</description>
Modified: support/trunk/pom.xml
===================================================================
--- support/trunk/pom.xml 2009-01-09 17:51:30 UTC (rev 7432)
+++ support/trunk/pom.xml 2009-01-09 17:54:56 UTC (rev 7433)
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-support</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JBoss Cache Support Modules</name>
<description>Grouping of JBoss Cache support modules</description>
Modified: support/trunk/xslt/pom.xml
===================================================================
--- support/trunk/xslt/pom.xml 2009-01-09 17:51:30 UTC (rev 7432)
+++ support/trunk/xslt/pom.xml 2009-01-09 17:54:56 UTC (rev 7433)
@@ -6,12 +6,12 @@
<parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-support</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
</parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-doc-xslt-support</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
<name>JBoss Cache Documentation XSLT support</name>
<description>JBoss Cache Documentation XSLT support</description>
15 years, 4 months
JBoss Cache SVN: r7432 - support/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-09 12:51:30 -0500 (Fri, 09 Jan 2009)
New Revision: 7432
Added:
support/tags/1.5/
Log:
Copied: support/tags/1.5 (from rev 7431, support/trunk)
15 years, 4 months
JBoss Cache SVN: r7431 - support/trunk/common.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-09 12:49:34 -0500 (Fri, 09 Jan 2009)
New Revision: 7431
Modified:
support/trunk/common/pom.xml
Log:
Modified: support/trunk/common/pom.xml
===================================================================
--- support/trunk/common/pom.xml 2009-01-09 16:38:44 UTC (rev 7430)
+++ support/trunk/common/pom.xml 2009-01-09 17:49:34 UTC (rev 7431)
@@ -332,12 +332,6 @@
<classifier>jdk15</classifier>
</dependency>
<dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.2.2.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
15 years, 4 months
JBoss Cache SVN: r7430 - core/trunk/src/main/java/org/jboss/cache/mvcc.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-09 11:38:44 -0500 (Fri, 09 Jan 2009)
New Revision: 7430
Modified:
core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
Log:
JBCACHE-1455 - Rollback corrupts nodes loaded from cache loader
Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java 2009-01-09 15:27:29 UTC (rev 7429)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java 2009-01-09 16:38:44 UTC (rev 7430)
@@ -172,11 +172,6 @@
private void reset()
{
backup = null;
- if (node != null)
- {
- super.setChildrenLoaded(isFlagSet(ORIG_CHILDREN_LOADED));
- super.setDataLoaded(isFlagSet(ORIG_DATA_LOADED));
- }
flags = 0;
}
@@ -232,6 +227,11 @@
public void rollbackUpdate()
{
node = backup;
+ if (node != null)
+ {
+ super.setChildrenLoaded(isFlagSet(ORIG_CHILDREN_LOADED));
+ super.setDataLoaded(isFlagSet(ORIG_DATA_LOADED));
+ }
reset();
}
15 years, 4 months
JBoss Cache SVN: r7429 - core/trunk/src/test/java/org/jboss/cache/integration/websession.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-01-09 10:27:29 -0500 (Fri, 09 Jan 2009)
New Revision: 7429
Modified:
core/trunk/src/test/java/org/jboss/cache/integration/websession/BuddyReplicationFailoverTest.java
Log:
more strict replication controll
Modified: core/trunk/src/test/java/org/jboss/cache/integration/websession/BuddyReplicationFailoverTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/integration/websession/BuddyReplicationFailoverTest.java 2009-01-09 15:01:53 UTC (rev 7428)
+++ core/trunk/src/test/java/org/jboss/cache/integration/websession/BuddyReplicationFailoverTest.java 2009-01-09 15:27:29 UTC (rev 7429)
@@ -29,6 +29,7 @@
import org.jboss.cache.buddyreplication.BuddyReplicationTestsBase;
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.commands.write.RemoveNodeCommand;
+import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
import org.jboss.cache.integration.websession.util.*;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.FileCacheLoaderConfig;
@@ -55,6 +56,7 @@
public static final String FILE_CL_ROOT_DIR = "./testFiles/BuddyReplicationFailoverTest";
private static int FOLDER_INDEX = 0;
+ ReplicationListener[] replListeners;
@Override
protected String getCacheConfigName()
@@ -78,12 +80,15 @@
public void beforeClass() throws Exception
{
super.beforeClass();
+
+ replListeners = new ReplicationListener[getNumCacheManagers()];
/* Make sure that the buddy group is formed before starting the tests */
List<Cache> createdCaches = new ArrayList<Cache>();
- for (CacheManager cacheMngr : getCacheManagers())
+ for (int i = 0; i < getCacheManagers().size(); i++)
{
- Cache cache = cacheMngr.getCache(getCacheConfigName(), false);
+ Cache cache = getCacheManagers().get(i).getCache(getCacheConfigName(), false);
createdCaches.add(cache);
+ replListeners[i] = ReplicationListener.getReplicationListener(cache);
}
BuddyReplicationTestsBase.waitForSingleBuddy(createdCaches);
}
@@ -124,12 +129,11 @@
// Create the session
SetAttributesServlet sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- ReplicationListener replListener1 = getReplicationListener(mgr1.getCache());
- replListener1.expectWithTx(PutDataMapCommand.class);
+ replListeners[1].expectWithTx(PutDataMapCommand.class);
Request req = new Request(mgr0, null, sas);
req.execute();
- replListener1.waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
String sessionId = sas.getSessionId();
assert sessionId != null : "session id is null";
@@ -138,23 +142,25 @@
// Modify the session
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- replListener1.expectWithTx(PutDataMapCommand.class);
+ replListeners[1].expectWithTx(PutDataMapCommand.class);
req = new Request(mgr0, sessionId, sas);
req.execute();
- replListener1.waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
// Fail over; request reads the session and then modifies the session
GetAttributesServlet gas = new GetAttributesServlet(Collections.singleton(KEY));
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
MultipleActionServlet mas = new MultipleActionServlet(gas, sas);
- ReplicationListener replListener0 = getReplicationListener(mgr0.getCache());
- replListener0.expectWithTx(PutDataMapCommand.class);
+ replListeners[0].expectWithTx(PutDataMapCommand.class);
+ replListeners[0].expect(DataGravitationCleanupCommand.class);
+ replListeners[1].expect(DataGravitationCleanupCommand.class);
req = new Request(mgr3, sessionId, mas);
- req.execute();
- replListener0.waitForReplicationToOccur();
-
+ req.execute();
+ replListeners[0].waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
+
assert sessionId.equals(mas.getSessionId()) : "wrong session id; expected " + sessionId + " got " + mas.getSessionId();
Integer integer = (Integer) gas.getReadAttributes().get(KEY);
assert integer != null : "null attribute value";
@@ -165,11 +171,11 @@
// Invalidate the session
InvalidationServlet invs = new InvalidationServlet();
- replListener0.expectWithTx(RemoveNodeCommand.class);
+ replListeners[0].expectWithTx(RemoveNodeCommand.class);
req = new Request(mgr3, sessionId, invs);
- req.execute();
- replListener0.waitForReplicationToOccur();
+ req.execute();
+ replListeners[0].waitForReplicationToOccur();
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr0.getCache());
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr1.getCache());
@@ -190,12 +196,11 @@
// Create the session
SetAttributesServlet sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- ReplicationListener replListener2 = getReplicationListener(mgr2.getCache());
- replListener2.expectWithTx(PutDataMapCommand.class);
+ replListeners[2].expectWithTx(PutDataMapCommand.class);
Request req = new Request(mgr1, null, sas);
req.execute();
- replListener2.waitForReplicationToOccur();
+ replListeners[2].waitForReplicationToOccur();
String sessionId = sas.getSessionId();
assert sessionId != null : "session id is null";
@@ -204,23 +209,25 @@
// Modify the session
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- replListener2.expectWithTx(PutDataMapCommand.class);
+ replListeners[2].expectWithTx(PutDataMapCommand.class);
req = new Request(mgr1, sessionId, sas);
req.execute();
- replListener2.waitForReplicationToOccur();
+ replListeners[2].waitForReplicationToOccur();
// Fail over; request reads the session and then modifies the session
GetAttributesServlet gas = new GetAttributesServlet(Collections.singleton(KEY));
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
MultipleActionServlet mas = new MultipleActionServlet(gas, sas);
- ReplicationListener replListener1 = getReplicationListener(mgr1.getCache());
- replListener1.expectWithTx(PutDataMapCommand.class);
-
+ replListeners[1].expectWithTx(PutDataMapCommand.class);
+ replListeners[1].expect(DataGravitationCleanupCommand.class);//data is removed from owner
+ replListeners[2].expect(DataGravitationCleanupCommand.class);//backup tree is removed
+
req = new Request(mgr0, sessionId, mas);
req.execute();
- replListener1.waitForReplicationToOccur();
-
+ replListeners[1].waitForReplicationToOccur();
+ replListeners[2].waitForReplicationToOccur();
+
assert sessionId.equals(mas.getSessionId()) : "wrong session id; expected " + sessionId + " got " + mas.getSessionId();
Integer integer = (Integer) gas.getReadAttributes().get(KEY);
assert integer != null : "null attribute value";
@@ -231,11 +238,11 @@
// Invalidate the session
InvalidationServlet invs = new InvalidationServlet();
- replListener1.expectWithTx(RemoveNodeCommand.class);
-
+ replListeners[1].expectWithTx(RemoveNodeCommand.class);
+
req = new Request(mgr0, sessionId, invs);
req.execute();
- replListener1.waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr0.getCache());
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr1.getCache());
@@ -256,12 +263,11 @@
// Create the session
SetAttributesServlet sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- ReplicationListener replListener1 = getReplicationListener(mgr1.getCache());
- replListener1.expectWithTx(PutDataMapCommand.class);
+ replListeners[1].expectWithTx(PutDataMapCommand.class);
Request req = new Request(mgr0, null, sas);
req.execute();
- replListener1.waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
String sessionId = sas.getSessionId();
assert sessionId != null : "session id is null";
@@ -270,23 +276,25 @@
// Modify the session
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- replListener1.expectWithTx(PutDataMapCommand.class);
+ replListeners[1].expectWithTx(PutDataMapCommand.class);
req = new Request(mgr0, sessionId, sas);
req.execute();
- replListener1.waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
// Fail over; request reads the session and then modifies the session
GetAttributesServlet gas = new GetAttributesServlet(Collections.singleton(KEY));
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
MultipleActionServlet mas = new MultipleActionServlet(gas, sas);
- ReplicationListener replListener0 = getReplicationListener(mgr0.getCache());
- replListener0.expectWithTx(PutDataMapCommand.class);
-
+ replListeners[0].expectWithTx(PutDataMapCommand.class);
+ replListeners[0].expect(DataGravitationCleanupCommand.class);
+ replListeners[1].expect(DataGravitationCleanupCommand.class);
+
req = new Request(mgr3, sessionId, mas);
req.execute();
- replListener0.waitForReplicationToOccur();
-
+ replListeners[0].waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
+
assert sessionId.equals(mas.getSessionId()) : "wrong session id; expected " + sessionId + " got " + mas.getSessionId();
Integer integer = (Integer) gas.getReadAttributes().get(KEY);
assert integer != null : "null attribute value";
@@ -297,19 +305,19 @@
// Modify the session again
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- replListener0.expectWithTx(PutDataMapCommand.class);
+ replListeners[0].expectWithTx(PutDataMapCommand.class);
req = new Request(mgr3, sessionId, sas);
req.execute();
- replListener0.waitForReplicationToOccur();
+ replListeners[0].waitForReplicationToOccur();
// Invalidate the session
InvalidationServlet invs = new InvalidationServlet();
- replListener0.expectWithTx(RemoveNodeCommand.class);
+ replListeners[0].expectWithTx(RemoveNodeCommand.class);
req = new Request(mgr3, sessionId, invs);
req.execute();
- replListener0.waitForReplicationToOccur();
+ replListeners[0].waitForReplicationToOccur();
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr0.getCache());
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr1.getCache());
@@ -330,12 +338,11 @@
// Create the session
SetAttributesServlet sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- ReplicationListener replListener2 = getReplicationListener(mgr2.getCache());
- replListener2.expectWithTx(PutDataMapCommand.class);
+ replListeners[2].expectWithTx(PutDataMapCommand.class);
Request req = new Request(mgr1, null, sas);
req.execute();
- replListener2.waitForReplicationToOccur();
+ replListeners[2].waitForReplicationToOccur();
String sessionId = sas.getSessionId();
assert sessionId != null : "session id is null";
@@ -344,23 +351,24 @@
// Modify the session
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- replListener2.expectWithTx(PutDataMapCommand.class);
+ replListeners[2].expectWithTx(PutDataMapCommand.class);
req = new Request(mgr1, sessionId, sas);
req.execute();
- replListener2.waitForReplicationToOccur();
+ replListeners[2].waitForReplicationToOccur();
// Fail over; request reads the session and then modifies the session
GetAttributesServlet gas = new GetAttributesServlet(Collections.singleton(KEY));
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
MultipleActionServlet mas = new MultipleActionServlet(gas, sas);
- ReplicationListener replListener1 = getReplicationListener(mgr1.getCache());
- replListener1.expectWithTx(PutDataMapCommand.class);
-
+ replListeners[1].expectWithTx(PutDataMapCommand.class);
+ replListeners[2].expect(DataGravitationCleanupCommand.class);
+
req = new Request(mgr0, sessionId, mas);
req.execute();
- replListener1.waitForReplicationToOccur();
-
+ replListeners[1].waitForReplicationToOccur();
+ replListeners[2].waitForReplicationToOccur();
+
assert sessionId.equals(mas.getSessionId()) : "wrong session id; expected " + sessionId + " got " + mas.getSessionId();
Integer integer = (Integer) gas.getReadAttributes().get(KEY);
assert integer != null : "null attribute value";
@@ -371,19 +379,19 @@
// Modify the session again
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- replListener1.expectWithTx(PutDataMapCommand.class);
+ replListeners[1].expectWithTx(PutDataMapCommand.class);
req = new Request(mgr0, sessionId, sas);
req.execute();
- replListener1.waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
// Invalidate the session
InvalidationServlet invs = new InvalidationServlet();
- replListener1.expectWithTx(RemoveNodeCommand.class);
+ replListeners[1].expectWithTx(RemoveNodeCommand.class);
req = new Request(mgr0, sessionId, invs);
req.execute();
- replListener1.waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr0.getCache());
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr1.getCache());
@@ -404,38 +412,44 @@
// Create the session
SetAttributesServlet sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- ReplicationListener replListener1 = getReplicationListener(mgr1.getCache());
- replListener1.expectWithTx(PutDataMapCommand.class);
+ replListeners[1].expectWithTx(PutDataMapCommand.class);
Request req = new Request(mgr0, null, sas);
req.execute();
- replListener1.waitForReplicationToOccur();
-
+ replListeners[1].waitForReplicationToOccur();
+ System.out.println("First put on 0, attr=" + attr);
+ TestingUtil.dumpCacheContents(mgr0.getCache(), mgr1.getCache(), mgr2.getCache(), mgr3.getCache());
+
String sessionId = sas.getSessionId();
assert sessionId != null : "session id is null";
// validate cache contents
BuddyReplicationAssertions.assertBuddyBackup(contextHostName, sessionId, mgr0.getCache(), mgr1.getCache());
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr2.getCache());
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr3.getCache());
-
+
// Modify the session
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- replListener1.expectWithTx(PutDataMapCommand.class);
+ replListeners[1].expectWithTx(PutDataMapCommand.class);
req = new Request(mgr0, sessionId, sas);
req.execute();
- replListener1.waitForReplicationToOccur();
-
+ replListeners[1].waitForReplicationToOccur();
+ System.out.println("Second put on 0, attr=" + attr);
+ TestingUtil.dumpCacheContents(mgr0.getCache(), mgr1.getCache(), mgr2.getCache(), mgr3.getCache());
+
// Fail over; request reads the session and then modifies the session
GetAttributesServlet gas = new GetAttributesServlet(Collections.singleton(KEY));
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
MultipleActionServlet mas = new MultipleActionServlet(gas, sas);
- ReplicationListener replListener0 = getReplicationListener(mgr0.getCache());
- replListener0.expectWithTx(PutDataMapCommand.class);
+ replListeners[0].expectWithTx(PutDataMapCommand.class);
+ replListeners[1].expect(DataGravitationCleanupCommand.class);
req = new Request(mgr3, sessionId, mas);
req.execute();
- replListener0.waitForReplicationToOccur();
+ replListeners[0].waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
+ System.out.println("First put on 3, attr=" + attr);
+ TestingUtil.dumpCacheContents(mgr0.getCache(), mgr1.getCache(), mgr2.getCache(), mgr3.getCache());
assert sessionId.equals(mas.getSessionId()) : "wrong session id; expected " + sessionId + " got " + mas.getSessionId();
Integer integer = (Integer) gas.getReadAttributes().get(KEY);
@@ -448,22 +462,24 @@
// Modify the session again
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
- replListener0.expectWithTx(PutDataMapCommand.class);
+ replListeners[0].expectWithTx(PutDataMapCommand.class);
req = new Request(mgr3, sessionId, sas);
req.execute();
- replListener0.waitForReplicationToOccur();
+ replListeners[0].waitForReplicationToOccur();
// Fail back; request reads the session and then modifies the session
gas = new GetAttributesServlet(Collections.singleton(KEY));
sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
mas = new MultipleActionServlet(gas, sas);
- replListener1.expectWithTx(PutDataMapCommand.class);
-
+ replListeners[1].expectWithTx(PutDataMapCommand.class);
+ replListeners[3].expect(DataGravitationCleanupCommand.class);
+
req = new Request(mgr0, sessionId, mas);
req.execute();
- replListener1.waitForReplicationToOccur();
-
+ replListeners[1].waitForReplicationToOccur();
+ replListeners[3].waitForReplicationToOccur();
+
assert sessionId.equals(mas.getSessionId()) : "wrong session id; expected " + sessionId + " got " + mas.getSessionId();
integer = (Integer) gas.getReadAttributes().get(KEY);
assert integer != null : "null attribute value";
@@ -475,11 +491,11 @@
// Invalidate the session
InvalidationServlet invs = new InvalidationServlet();
- replListener1.expectWithTx(RemoveNodeCommand.class);
+ replListeners[1].expectWithTx(RemoveNodeCommand.class);
req = new Request(mgr0, sessionId, invs);
req.execute();
- replListener1.waitForReplicationToOccur();
+ replListeners[1].waitForReplicationToOccur();
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr0.getCache());
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr1.getCache());
@@ -523,7 +539,7 @@
req = new Request(mgr3, sessionId, sas);
req.execute();
replListener0.waitForReplicationToOccur();
-
+
// Passivate the session
mgr0.passivate(sessionId);
mgr1.passivate(sessionId);
@@ -535,7 +551,7 @@
replListener0.expectWithTx(PutDataMapCommand.class);
req = new Request(mgr3, sessionId, sas);
- req.execute();
+ req.execute();
replListener0.waitForReplicationToOccur();
// Invalidate the session
@@ -544,11 +560,14 @@
MultipleActionServlet mas = new MultipleActionServlet(sas, invs);
ReplicationListener replListener1 = getReplicationListener(mgr1.getCache());
replListener1.expectWithTx(PutDataMapCommand.class, RemoveNodeCommand.class);
-
+ replListener1.expect(DataGravitationCleanupCommand.class);
+
req = new Request(mgr0, sessionId, mas);
req.execute();
replListener1.waitForReplicationToOccur();
+ TestingUtil.dumpCacheContents(mgr0.getCache(), mgr1.getCache(), mgr2.getCache(), mgr3.getCache());
+
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr0.getCache());
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr1.getCache());
BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr2.getCache());
15 years, 4 months
JBoss Cache SVN: r7428 - core/trunk/src/main/java/org/jboss/cache/mvcc.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-09 10:01:53 -0500 (Fri, 09 Jan 2009)
New Revision: 7428
Modified:
core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
Log:
JBCACHE-1455 - Rollback corrupts nodes loaded from cache loader
Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java 2009-01-09 14:08:22 UTC (rev 7427)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java 2009-01-09 15:01:53 UTC (rev 7428)
@@ -172,8 +172,11 @@
private void reset()
{
backup = null;
- super.setChildrenLoaded(isFlagSet(ORIG_CHILDREN_LOADED));
- super.setDataLoaded(isFlagSet(ORIG_DATA_LOADED));
+ if (node != null)
+ {
+ super.setChildrenLoaded(isFlagSet(ORIG_CHILDREN_LOADED));
+ super.setDataLoaded(isFlagSet(ORIG_DATA_LOADED));
+ }
flags = 0;
}
15 years, 4 months
JBoss Cache SVN: r7427 - in core/trunk/src: main/java/org/jboss/cache/mvcc and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-09 09:08:22 -0500 (Fri, 09 Jan 2009)
New Revision: 7427
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderWithRollbackTest.java
Log:
JBCACHE-1455 - Rollback corrupts nodes loaded from cache loader
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2009-01-09 12:45:40 UTC (rev 7426)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2009-01-09 14:08:22 UTC (rev 7427)
@@ -117,11 +117,11 @@
{
if (command.isErase())
{
- replace(ctx, command.getFqn());
+ replace(ctx, command.getFqn());
}
else
{
- loadIfNeeded(ctx, command.getFqn(), null, true, true, false, false, false, false, true);
+ loadIfNeeded(ctx, command.getFqn(), null, true, true, false, false, false, false, true);
}
}
return invokeNextInterceptor(ctx, command);
@@ -215,7 +215,7 @@
public Object visitRollbackCommand(InvocationContext ctx, RollbackCommand command) throws Throwable
{
// clean up nodesCreated map
- if (trace) log.trace("Removing temporarily created nodes from treecache");
+ if (trace) log.trace("Removing temporarily created nodes");
// this needs to be done in reverse order.
List list = ctx.getTransactionContext().getDummyNodesCreatedByCacheLoader();
@@ -268,7 +268,7 @@
}
return invokeNextInterceptor(ctx, command);
}
-
+
private void replace(InvocationContext ctx, Fqn fqn) throws InterruptedException
{
NodeSPI n = helper.wrapNodeForReading(ctx, fqn, true);
Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java 2009-01-09 12:45:40 UTC (rev 7426)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java 2009-01-09 14:08:22 UTC (rev 7427)
@@ -50,7 +50,7 @@
protected static enum Flags
{
- CHANGED(0x1), CREATED(0x2), DELETED(0x4);
+ CHANGED(0x1), CREATED(0x2), DELETED(0x4), ORIG_DATA_LOADED(0x8), ORIG_CHILDREN_LOADED(0x16);
final byte mask;
Flags(int mask)
@@ -132,7 +132,9 @@
{
Fqn fqn = getFqn();
if (trace)
+ {
log.trace("Updating node [" + fqn + "]. deleted=" + isDeleted() + " valid=" + isValid() + " changed=" + isChanged() + " created=" + isFlagSet(CREATED));
+ }
// check if node has been deleted.
if (isFlagSet(DELETED))
@@ -170,6 +172,8 @@
private void reset()
{
backup = null;
+ super.setChildrenLoaded(isFlagSet(ORIG_CHILDREN_LOADED));
+ super.setDataLoaded(isFlagSet(ORIG_DATA_LOADED));
flags = 0;
}
@@ -201,7 +205,9 @@
retval = container.peekInternalNode(parentFqn, false);
}
if (retval == null)
+ {
throw new NodeNotExistsException("Node " + parentFqn + " cannot be found in any context or data container!");
+ }
return retval;
}
@@ -242,9 +248,13 @@
public void setCreated(boolean created)
{
if (created)
+ {
setFlag(CREATED);
+ }
else
+ {
unsetFlag(CREATED);
+ }
}
// do not delegate deletion flags to the InternalNode since this will cause problems with concurrent readers. Maintain
@@ -260,9 +270,13 @@
public void markAsDeleted(boolean deleted)
{
if (deleted)
+ {
setFlag(DELETED);
+ }
else
+ {
unsetFlag(DELETED);
+ }
}
@Override
@@ -270,4 +284,18 @@
{
throw new UnsupportedOperationException("Recursive deletion not allowed!");
}
+
+ @Override
+ public void setChildrenLoaded(boolean loaded)
+ {
+ if (node.isChildrenLoaded()) setFlag(ORIG_CHILDREN_LOADED);
+ super.setChildrenLoaded(loaded);
+ }
+
+ @Override
+ public void setDataLoaded(boolean loaded)
+ {
+ if (node.isDataLoaded()) setFlag(ORIG_DATA_LOADED);
+ super.setDataLoaded(loaded);
+ }
}
Modified: core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderWithRollbackTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderWithRollbackTest.java 2009-01-09 12:45:40 UTC (rev 7426)
+++ core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderWithRollbackTest.java 2009-01-09 14:08:22 UTC (rev 7427)
@@ -19,10 +19,17 @@
final Fqn fqn = Fqn.fromString("/a/b");
final String key = "key";
+ protected Configuration.NodeLockingScheme getNodeLockingScheme()
+ {
+ return Configuration.NodeLockingScheme.MVCC;
+ }
+
+
public Cache<String, String> init(boolean passivation) throws Exception
{
CacheLoaderConfig cacheLoaderConfig = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(passivation, "", DummyInMemoryCacheLoader.class.getName(), "", false, true, false, false, false);
Configuration cfg = new Configuration();
+ cfg.setNodeLockingScheme(getNodeLockingScheme());
cfg.setCacheLoaderConfig(cacheLoaderConfig);
cfg.getRuntimeConfig().setTransactionManager(new DummyTransactionManager());
Cache<String, String> cache = new DefaultCacheFactory<String, String>().createCache(cfg);
15 years, 4 months
JBoss Cache SVN: r7426 - core/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-09 07:45:40 -0500 (Fri, 09 Jan 2009)
New Revision: 7426
Modified:
core/trunk/pom.xml
Log:
Updated to EasyMock 2.4
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2009-01-09 10:05:30 UTC (rev 7425)
+++ core/trunk/pom.xml 2009-01-09 12:45:40 UTC (rev 7426)
@@ -93,7 +93,7 @@
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
- <version>2.3</version>
+ <version>2.4</version>
<scope>test</scope>
</dependency>
<dependency>
15 years, 4 months
JBoss Cache SVN: r7425 - core/trunk/src/test/java/org/jboss/cache/integration/websession/util.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-01-09 05:05:30 -0500 (Fri, 09 Jan 2009)
New Revision: 7425
Modified:
core/trunk/src/test/java/org/jboss/cache/integration/websession/util/WebSessionTestBase.java
Log:
stick to the dafult protocol stack
Modified: core/trunk/src/test/java/org/jboss/cache/integration/websession/util/WebSessionTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/integration/websession/util/WebSessionTestBase.java 2009-01-09 09:54:23 UTC (rev 7424)
+++ core/trunk/src/test/java/org/jboss/cache/integration/websession/util/WebSessionTestBase.java 2009-01-09 10:05:30 UTC (rev 7425)
@@ -30,6 +30,7 @@
import org.jboss.cache.Cache;
import org.jboss.cache.CacheManager;
import org.jboss.cache.CacheStatus;
+import org.jboss.cache.factories.UnitTestConfigurationFactory;
import org.jboss.cache.integration.CacheManagerSupport;
import org.jboss.cache.integration.UnitTestCacheFactoryConfigurationRegistry;
import org.jboss.cache.integration.websession.util.WebAppMetadata.Granularity;
@@ -59,12 +60,14 @@
cacheManagers = CacheManagerSupport.createCacheManagers(getNumCacheManagers(), getCacheConfigFileName(), getStacksXmlFileName());
if (getStartCachesInBeforeClass() && getCacheConfigName() != null)
{
+ String inUseProtocolStack = UnitTestConfigurationFactory.getEmptyConfiguration().getClusterConfig();
for (CacheManager cm : cacheManagers)
{
Cache<Object, Object> cache = cm.getCache(getCacheConfigName(), true);
amendCacheBeforeStartup(cache);
if (cache.getCacheStatus() != CacheStatus.STARTED)
{
+ cache.getConfiguration().setClusterConfig(inUseProtocolStack);
cache.start();
}
replicationListeners.put(cache, ReplicationListener.getReplicationListener(cache));
15 years, 4 months