Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-08-06 00:29:29 -0400
committerEike Stepper2013-08-06 00:43:18 -0400
commit482f9f0cddc8610c5252657c3a11be91cda8647a (patch)
tree3106400fe73a43c0582c11c8067692c146eb1b44
parent902e8835d4e7b95ded3bd594ed786dddf2d38577 (diff)
downloadcdo-committers/estepper/invalidations.tar.gz
cdo-committers/estepper/invalidations.tar.xz
cdo-committers/estepper/invalidations.zip
[414453] CDOSessionImpl can "freeze" during invalidation reordering committers/estepper/invalidations
https://bugs.eclipse.org/bugs/show_bug.cgi?id=414453
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java25
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (H2 offline).launch2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java2
4 files changed, 20 insertions, 13 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
index 9d5c13f363..4f3ffc4064 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
@@ -366,6 +366,8 @@ public abstract class SynchronizableRepository extends Repository.Default implem
{
try
{
+ long previousCommitTime = getLastCommitTimeStamp();
+
int fromBranchID = lastReplicatedBranchID + 1;
int toBranchID = in.readInt();
long fromCommitTime = lastReplicatedCommitTime + 1L;
@@ -377,7 +379,7 @@ public abstract class SynchronizableRepository extends Repository.Default implem
replicateRawReviseRevisions();
replicateRawReloadLocks();
- replicateRawNotifyClients(lastReplicatedCommitTime, toCommitTime);
+ replicateRawNotifyClients(lastReplicatedCommitTime, toCommitTime, previousCommitTime);
setLastReplicatedBranchID(toBranchID);
setLastReplicatedCommitTime(toCommitTime);
@@ -422,7 +424,7 @@ public abstract class SynchronizableRepository extends Repository.Default implem
getLockingManager().reloadLocks();
}
- private void replicateRawNotifyClients(long fromCommitTime, long toCommitTime)
+ private void replicateRawNotifyClients(long fromCommitTime, long toCommitTime, long previousCommitTime)
{
InternalCDOCommitInfoManager manager = getCommitInfoManager();
InternalSessionManager sessionManager = getSessionManager();
@@ -447,7 +449,7 @@ public abstract class SynchronizableRepository extends Repository.Default implem
CDOCommitData data = CDOCommitInfoUtil.createCommitData(newPackages, newObjects, changedObjects, detachedObjects);
String comment = "<replicate raw commits>"; //$NON-NLS-1$
- CDOCommitInfo commitInfo = manager.createCommitInfo(branch, toCommitTime, fromCommitTime, SYSTEM_USER_ID,
+ CDOCommitInfo commitInfo = manager.createCommitInfo(branch, toCommitTime, previousCommitTime, SYSTEM_USER_ID,
comment, data);
sessionManager.sendCommitNotification(replicatorSession, commitInfo, true);
}
@@ -909,6 +911,8 @@ public abstract class SynchronizableRepository extends Repository.Default implem
{
private static final int ARTIFICIAL_VIEW_ID = 0;
+ private CommitTransactionResult result;
+
public WriteThroughCommitContext(InternalTransaction transaction)
{
super(transaction);
@@ -1024,7 +1028,7 @@ public abstract class SynchronizableRepository extends Repository.Default implem
// Delegate commit to the master
CDOSessionProtocol sessionProtocol = getSynchronizer().getRemoteSession().getSessionProtocol();
- CommitTransactionResult result = sessionProtocol.commitDelegation(ctx, monitor);
+ result = sessionProtocol.commitDelegation(ctx, monitor);
// Stop if commit to master failed
String rollbackMessage = result.getRollbackMessage();
@@ -1034,8 +1038,7 @@ public abstract class SynchronizableRepository extends Repository.Default implem
}
// Prepare data needed for commit result and commit notifications
- long timeStamp = result.getTimeStamp();
- setTimeStamp(timeStamp);
+ long timeStamp = result.getTimeStamp(); // result is set to null later!
addIDMappings(result.getIDMappings());
applyIDMappings(new Monitor());
@@ -1064,10 +1067,14 @@ public abstract class SynchronizableRepository extends Repository.Default implem
@Override
protected long[] createTimeStamp(OMMonitor monitor)
{
- // Already set after commit to the master.
- // Do not call getTimeStamp() of the enclosing Repo class!!!
+ long timeStamp = result.getTimeStamp();
+ long previousTimeStamp = result.getPreviousTimeStamp();
+ result = null;
+
InternalRepository repository = getTransaction().getSession().getManager().getRepository();
- return repository.forceCommitTimeStamp(WriteThroughCommitContext.this.getTimeStamp(), monitor);
+ repository.forceCommitTimeStamp(timeStamp, monitor);
+
+ return new long[] { timeStamp, previousTimeStamp };
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (H2 offline).launch b/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (H2 offline).launch
index 9377b6329f..ab48587083 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (H2 offline).launch
+++ b/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (H2 offline).launch
@@ -21,5 +21,5 @@
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.db.offline.AllTestsDBH2Offline"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests.db"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx1024m&#13;&#10;-Dorg.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.enableServerBrowser=true"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx1024m&#13;&#10;-Dorg.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.enableServerBrowser=true&#13;&#10;-Dorg.eclipse.net4j.util.om.trace.disable=true"/>
</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java
index 8dab040d42..dfb70f2e8f 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java
@@ -667,7 +667,7 @@ public class OfflineTest extends AbstractSyncingTest
InternalRepository clone = getRepository();
waitForOnline(clone);
- CDOSession session = openSession();
+ CDOSession session = openSession(); // Session2 [repo1]
session.options().setPassiveUpdateMode(PassiveUpdateMode.ADDITIONS);
CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
@@ -686,7 +686,7 @@ public class OfflineTest extends AbstractSyncingTest
transaction.addListener(transactionListener);
{
- CDOSession masterSession = openSession("master");
+ CDOSession masterSession = openSession("master"); // Session3 [master]
CDOTransaction masterTransaction = masterSession.openTransaction();
CDOResource masterResource = masterTransaction.getResource(getResourcePath("/my/resource"));
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
index 21b7176b39..e20477f37b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
@@ -1649,7 +1649,7 @@ public abstract class CDOSessionImpl extends CDOTransactionContainerImpl impleme
*/
private class Invalidator extends QueueRunner2<Invalidation>
{
- private static final boolean DEBUG = true;
+ private static final boolean DEBUG = false;
private final Set<Object> unfinishedLocalCommits = new HashSet<Object>();

Back to the top