Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319674 - Offline: Support id mapping during branch switch
Summary: Offline: Support id mapping during branch switch
Status: ASSIGNED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.13   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: offline-03
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-13 05:19 EDT by Erwin Betschart CLA
Modified: 2020-12-11 10:37 EST (History)
0 users

See Also:


Attachments
Patch to support id mappings on branch switches (8.47 KB, patch)
2010-07-13 05:29 EDT, Erwin Betschart CLA
stepper: iplog+
Details | Diff
Testcase for id mapping (6.92 KB, patch)
2010-07-13 07:52 EDT, Erwin Betschart CLA
stepper: iplog+
Details | Diff
Patch v1 - incomplete (33.99 KB, patch)
2010-07-24 02:04 EDT, Eike Stepper CLA
no flags Details | Diff
Patch v2 - incomplete (56.81 KB, patch)
2010-07-30 01:20 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erwin Betschart CLA 2010-07-13 05:19:51 EDT
Build Identifier: 4.0

Objects created on a local offline branch have a big id. After a merge to an online branch these merged objects have a new id.
Example:
-> View V opened on local branch -1
-> Object A is created offline: A@99999999999
-> Merge branch -1 to main branch
-> View V is switched to main branch 0
-> Object A becomes invalid because on the main branch a new id is assigned (e.g. A@22).

The state of objects which are valid on both branches becomes PROXY and these object are reloaded on access.
Offline created object are detached after the branch switch because these object to not exist on the main brach.
It would be nice to apply an id mapping on the view on the main brach after a branch switch. By this it would be possible to keep references on offline created objects.

Reproducible: Always
Comment 1 Erwin Betschart CLA 2010-07-13 05:29:30 EDT
Created attachment 174123 [details]
Patch to support id mappings on branch switches

Tried not to change public api.
- In CDOTransactionImpl.mapLocalIds the id mapping is stored in the merger because CDOTransaction already returns the change set.
- When switching the branch on a view the mapping is given to the setBranchPoint method (which is defined in InternalCDOView.


Flaws:
- The merger cannot be used concurrently because the id mapping is overwritten.
- Had to change internal API: InternalCDOView, InternalCDOTransaction
- Merger API changed.
Comment 2 Erwin Betschart CLA 2010-07-13 05:30:42 EDT
Will add a testcase which checks if references to offline created object are correctly mapped.
Comment 3 Erwin Betschart CLA 2010-07-13 07:52:51 EDT
Created attachment 174126 [details]
Testcase for id mapping

This testcase checks if the offline created objects can be reused after a branch switch and if multiple offline created objects having references to each other can be normally accessed after the branch switch. 
-> Only use this patch after patch 174123 is applied.
Comment 4 Erwin Betschart CLA 2010-07-13 07:56:15 EDT
I confirm to
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.

for each attachment.
Comment 5 Eike Stepper CLA 2010-07-24 02:04:05 EDT
Created attachment 175124 [details]
Patch v1 - incomplete

New approach:

- Collect idMappings where they arise (tx: applyChangeSetData and commit)
- Transport to server
- Persist with commitInfo
- Notify to other sessions, but DON'T cache them there!
- When they are needed during particular branch switches of a CDOView, request them from the server (ChangeViewTargetRequest), use and release them.
Comment 6 Eike Stepper CLA 2010-07-30 01:20:52 EDT
Created attachment 175540 [details]
Patch v2 - incomplete
Comment 7 Eike Stepper CLA 2011-06-23 03:59:01 EDT
Moving all open enhancement requests to 4.1
Comment 8 Eike Stepper CLA 2012-08-14 22:53:29 EDT
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
Comment 9 Eike Stepper CLA 2013-06-27 04:08:53 EDT
Moving all outstanding enhancements to 4.3
Comment 10 Eike Stepper CLA 2014-08-19 09:28:21 EDT
Moving all open enhancement requests to 4.4
Comment 11 Eike Stepper CLA 2014-08-19 09:37:35 EDT
Moving all open enhancement requests to 4.4
Comment 12 Eike Stepper CLA 2015-07-14 02:14:52 EDT
Moving all open bugzillas to 4.5.
Comment 13 Eike Stepper CLA 2016-07-31 00:57:49 EDT
Moving all unaddressed bugzillas to 4.6.
Comment 14 Eike Stepper CLA 2017-12-28 01:11:45 EST
Moving all open bugs to 4.7
Comment 15 Eike Stepper CLA 2019-11-08 02:10:46 EST
Moving all unresolved issues to version 4.8-
Comment 16 Eike Stepper CLA 2019-12-13 12:50:16 EST
Moving all unresolved issues to version 4.9
Comment 17 Eike Stepper CLA 2020-12-11 10:37:50 EST
Moving to 4.13.