Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351078 - [DB] Support raw replication in HorizontalBranchingMappingStrategyWithRanges
Summary: [DB] Support raw replication in HorizontalBranchingMappingStrategyWithRanges
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.db (show other bugs)
Version: 4.1   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: Lighter, Faster and Better
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-04 08:13 EDT by Cyril Jaquier CLA
Modified: 2012-09-21 07:17 EDT (History)
4 users (show)

See Also:
stepper: review-


Attachments
Patch v1 (68.94 KB, patch)
2011-09-12 23:52 EDT, Eike Stepper CLA
no flags Details | Diff
Patch v2 - ready to be committed (68.97 KB, patch)
2011-09-13 00:20 EDT, Eike Stepper CLA
no flags Details | Diff
Patch v3 (71.75 KB, patch)
2011-09-13 01:47 EDT, Eike Stepper CLA
no flags Details | Diff
Patch 2 (incremental) (15.57 KB, patch)
2011-10-08 00:31 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 Cyril Jaquier CLA 2011-07-04 08:13:30 EDT
Build Identifier: 4.0 GA

HorizontalBranchingMappingStrategyWithRanges does not implement:

rawImportUnreviseNewRevisions
rawImportReviseOldRevisions

and thus raw replication is not working with this mapping strategy.

Reproducible: Always
Comment 1 Eike Stepper CLA 2011-07-04 08:24:04 EDT
Hi Stefan, this may have to be implemented by me, but I have almost no knowledge about the ranges baes mapping strategies...
Comment 2 Eike Stepper CLA 2011-09-12 23:22:40 EDT
Committed revision 9062:
- trunk/plugins/org.eclipse.emf.cdo.server.db
Comment 3 Eike Stepper CLA 2011-09-12 23:39:24 EDT
Committed revision 9063:
- trunk/plugins/org.eclipse.emf.cdo.tests
Comment 4 Eike Stepper CLA 2011-09-12 23:52:15 EDT
Created attachment 203203 [details]
Patch v1

1) UnsupportedOperationExceptions because rawImportUnreviseNewRevisions() and rawImportReviseOldRevisions() are not properly overridden. I fixed this by changing the inheritance hierarchy from

		AbstractHorizontalMappingStrategy
			HorizontalAuditMappingStrategy
			HorizontalAuditMappingStrategyWithRanges
			HorizontalBranchingMappingStrategy
			HorizontalBranchingMappingStrategyWithRanges

to
			
		AbstractHorizontalMappingStrategy
			HorizontalAuditMappingStrategy
				HorizontalAuditMappingStrategyWithRanges
			HorizontalBranchingMappingStrategy
				HorizontalBranchingMappingStrategyWithRanges
			
2) The list joins for range-based list mappings are different

3) The main challenge is that the range-based list mappings change DB values (namely the CDO_VERSION_REMOVED field) in the *past*. This has no precendence in replicated scenarios and causes deep impact especially in:
		a) DBUtil.deserializeTable (a new row handler for post processing is needed, additional serializeTable/deserializeTable methods are needed to keep APIs compatible) and in 
		b) all DBTypes (the transferred values must be returned for possible post processing, entire new methods are needed to keep APIs compatible, i.e. readValueWithResult/writeValueWithResult).
Comment 5 Eike Stepper CLA 2011-09-12 23:58:12 EDT
Stefan, please review. I'll try to hunt down a new regression in OfflineTest.testDisconnectAndSyncAddition(). All other tests are passing...
Comment 6 Eike Stepper CLA 2011-09-13 00:20:33 EDT
Created attachment 203205 [details]
Patch v2 - ready to be committed

Regression fixed.
Comment 7 Eike Stepper CLA 2011-09-13 01:47:19 EDT
Created attachment 203208 [details]
Patch v3
Comment 8 Eike Stepper CLA 2011-09-13 01:49:39 EDT
Committed revision 9067:
- trunk/plugins/org.eclipse.emf.cdo.server.db
- trunk/plugins/org.eclipse.emf.cdo.tests
- trunk/plugins/org.eclipse.emf.cdo.tests.db
- trunk/plugins/org.eclipse.net4j.db
- trunk/plugins/org.eclipse.net4j.tests
Comment 9 Eike Stepper CLA 2011-09-13 01:50:55 EDT
I've committed patch v3 because I need a clean workspace and all tests are now passing. Stefan, I'm not resolving this bug until after your review ;-)
Comment 10 Eike Stepper CLA 2011-09-13 11:26:15 EDT
After talking to Stefan it turned out that my implementation does not yet consider index positions that have been removed entirely, as opposed to those that have been just added or moved within the list. Will work on a fix tomorrow...
Comment 11 Eike Stepper CLA 2011-09-15 23:52:11 EDT
Committed revision 9120:
- trunk/plugins/org.eclipse.emf.cdo.tests
Comment 12 Eike Stepper CLA 2011-09-16 00:44:41 EDT
Committed revision 9121:
- trunk/plugins/org.eclipse.emf.cdo.tests
Comment 13 Eike Stepper CLA 2011-09-30 04:49:20 EDT
Our original assumption that we can ignore the null-valued VERSION_REMOVED fields turned out to be wrong. Working on a fix...
Comment 14 Eike Stepper CLA 2011-10-08 00:31:07 EDT
Created attachment 204783 [details]
Patch 2 (incremental)

The tests in WithRanges scenarios now validate the results on table level. The patch fixes the resulting 6 failures by postprocessing the VERSION_REMOVED column.
Comment 15 Eike Stepper CLA 2011-10-08 00:31:32 EDT
Committed revision 9464:
- trunk/plugins/org.eclipse.emf.cdo.server.db
- trunk/plugins/org.eclipse.emf.cdo.tests
- trunk/plugins/org.eclipse.emf.cdo.tests.db
Comment 16 Eike Stepper CLA 2011-10-08 00:31:48 EDT
Fixed
Comment 17 Eike Stepper CLA 2012-09-21 07:17:31 EDT
Closing.