Community
Participate
Working Groups
Build Identifier: If using a DBStore with HorizontalBranchingMappingStrategyWithRanges, when trying to load the commit infos in a branch, once the repository has been shut down and restarted, the obtained commit info contains uneccessary elements in the changed objects list. It seems that when list features of two revisions of a changed object are compared, the old revision's list is filled with CDORevisionUtil.UNINITIALIZED elements, while the new revision contains loaded CDOIDs. CDORevisionDeltaImpl.compare will create ADD and REMOVE feature deltas. Happens only when loading commit info from branch and using the 'withRanges' mapping strategy. Reproducible: Always Steps to Reproduce: 1. Open a CDO repository connection 2. If not exists, create a resource and add sample elements to it 3. Create a branch and commit an additional element to the resource 4. Inspect the commit info in the branch -> correct 5. Dispose CDO connection and connect to the repository again 6. Try to inspect the same commit info -> incorrect elements appear in the changed objects list
Created attachment 191000 [details] Test project to reproduce the error Attaching a test project that contains unit tests to reproduce the bug. The class LoadCommitDataFromBranchTest contains the test case.
After digging into the issue if I understand correctly the following happens: The incorrect initialization of the base revision happens in the readValues() method of the BranchingListTableMappingWithRanges class. When the current revision of an object in the branch is initialized, in case of using chunk loading, list features are initialized partially from the base revision from the parent branch. In order to do this the createBaseChunkReader() method creates the base revision, but as the chunk size is hardcoded to 0, its lists remain uninitialized. This revision however gets into the revision cache. When later the delta between the two revisions is calculated, the uninitialized base revision is grabbed from the cache, thus the compare will result invalid values. One solution I tried was to initialize the base revision also by providing -1 for the chunk size in the createBaseChunkReader() method instead of 0, but this resulted in an exception from the SmartPreparedStatementCache.Cache class put() method: org.eclipse.net4j.util.ImplementationError: SELECT cdo_idx, cdo_value FROM eresource_CDOResource_contents_list WHERE cdo_source=? AND cdo_branch=? AND cdo_version_added<=? AND (cdo_version_removed IS NULL OR cdo_version_removed>?) ORDER BY cdo_idx already in cache at org.eclipse.emf.cdo.server.internal.db.SmartPreparedStatementCache$Cache.put(SmartPreparedStatementCache.java:123) at org.eclipse.emf.cdo.server.internal.db.SmartPreparedStatementCache.releasePreparedStatement(SmartPreparedStatementCache.java:61) at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.BranchingListTableMappingWithRanges.readValues(BranchingListTableMappingWithRanges.java:384) This bug is probably related to the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=339313 , which solves the exception caused by the uninitalized lists, but doesn't solve the initialization itself. Do you have any hint where the initialization of the base revision should happen?
Created attachment 194144 [details] CDO test case to reproduce the error Attaching a test case patch for the project org.eclipse.emf.cdo.test that reproduces the error.
Created attachment 194245 [details] Test v2
Moving all open bug reports to 4.1 because the release is very near and it's hghly unlikely that there will be spare time to address 4.0 problems. Please make sure that your patches can be applied against the master branch and that your problem is not already fixed there!!!
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
We'll try to address open problems in 4.3 (master) first and then port fixes back to 4.2.
Moving all open bugzillas to 4.5.
Moving all unaddressed bugzillas to 4.6.
Moving all open bugs to 4.7
Moving all unresolved issues to version 4.8-
Moving all unresolved issues to version 4.9
Moving to 4.13.