Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319552

Summary: "Attempt to modify historical revision"-Exception after raw replication.
Product: [Modeling] EMF Reporter: Pascal Lehmann <pascal.lehmann>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: stepper
Version: 4.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: offline-01
Attachments:
Description Flags
TestCase
stepper: iplog+
Idea for a patch stepper: iplog+

Description Pascal Lehmann CLA 2010-07-12 09:06:19 EDT
Build Identifier: 4.0

We have the following scenario (see attached test-case):
master session with a transaction where the changes are done and an offline session which will go offline and online again.

online:  ---> v1 ---> v2 ---> v3 ---> v4
offline: ---> v1 --/....................../(rawrepl.)--> v2

After the change v1 we go offline, do 3 more changes on online transaction.
Then we go online again, raw replication will start and will deliver changes v2-v4 in one revision delta causing the transaction on the offline clone to update from v1 to v2. When a change on this object is done, the exception is thrown because v4 is expected instead of v2.


Reproducible: Always

Steps to Reproduce:
1. see testcase
Comment 1 Pascal Lehmann CLA 2010-07-12 09:09:37 EDT
Created attachment 174018 [details]
TestCase
Comment 2 Pascal Lehmann CLA 2010-07-12 09:18:34 EDT
Created attachment 174020 [details]
Idea for a patch

Here is a patch resolving the version problem, but unfortunately this patch introduces some other problems, so I'm not sure if this would be the way to go.

The patch uses the higher version in the revision delta, so when applying the delta to the local revision the version will be correct. However every piece of code trying to get the revision from revision manager (eg. for the old value etc.) will now fail because the call is done with the higher version which can not be found in the revision manager.
Comment 3 Eike Stepper CLA 2010-07-15 12:15:05 EDT
Pascal, please confirm that:

1) The number of lines that you changed is smaller than 250.
2) You are the only author of these changed lines.
3) You apply the EPL to these changed lines.
Comment 4 Eike Stepper CLA 2010-07-15 12:15:36 EDT
Committed test case to HEAD
Comment 5 Pascal Lehmann CLA 2010-07-15 12:56:48 EDT
1) The number of lines that you changed is smaller than 250.
confirmed.
2) You are the only author of these changed lines.
confirmed.
3) You apply the EPL to these changed lines.
confirmed.
Comment 6 Eike Stepper CLA 2010-07-15 12:59:38 EDT
Comment on attachment 174020 [details]
Idea for a patch

This fix does not solve the problem that we need the target version of the aggregated deltas. Investigating further...
Comment 7 Eike Stepper CLA 2010-07-15 14:03:36 EDT
Fixed by adding this to CDORevisionDeltaImpl:

    private CDOBranchVersion target;
    
Committed to HEAD
Comment 8 Eike Stepper CLA 2011-06-23 03:40:15 EDT
Available in R20110608-1407