[
https://issues.apache.org/jira/browse/OAK-6051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15963976#comment-15963976
]
Andrei Dulceanu commented on OAK-6051:
--------------------------------------
Background: the two failing tests, {{SegmentToExternalMigrationTest}} and
{{ExternalToExternalMigrationTest}}, are trying to migrate binaries stored in a
segment store (former) and in a blob store (latter) to a new blob store.
When merging the changes from the migration, the two node states corresponding
to initial content and migrated content need to be compared to tell if there
are changes to be committed ({{Commit#hasChanges}}). At this step, if the
shallow {{SegmentNodeState#fastEquals}} is used, changes will be seen since the
two {{Record}} instances are different (also they have different stable ids)
and the commit will be applied. On the other hand, if the deep
{{SegmentNodeState#equals}} is used, the two states will be seen as equal,
since {{SegmentNodeState#equals}} falls back on comparing the two states by
template, by node and ultimately by property if the short-circuit call to
{{SegmentNodeState#fastEquals}} returns {{false}}. Therefore the commit will
not be applied in this case, causing the test(s) to fail.
I suggest adding a comment like "SegmentNodeState#fastEquals should be used
here to prevent incorrect behaviour in migrations" inside {{Commit#hasChanges}}.
[~mduerig], WDYT?
> Clarify migration tests failures when switching Commit#hasChanges
> implementations
> ---------------------------------------------------------------------------------
>
> Key: OAK-6051
> URL: https://issues.apache.org/jira/browse/OAK-6051
> Project: Jackrabbit Oak
> Issue Type: Task
> Components: segment-tar
> Reporter: Andrei Dulceanu
> Assignee: Andrei Dulceanu
> Priority: Minor
> Fix For: 1.8, 1.7.3
>
>
> Currently, the implementation used to tell if there are changes in a commit
> to be merged (comparing the base state against the node state) uses
> {{SegmentNodeState#fastEquals}} directly (and consequently making that method
> public). Although comparing the node states through {{equals}}, which in turn
> should then delegate to {{fastEquals}}, should work, the following tests are
> failing when using this method:
> {code}
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.41 sec <<<
> FAILURE! - in
> org.apache.jackrabbit.oak.segment.migration.ExternalToExternalMigrationTest
> blobsExistsOnTheNewBlobStore(org.apache.jackrabbit.oak.segment.migration.ExternalToExternalMigrationTest)
> Time elapsed: 0.082 sec <<< ERROR!
> java.io.IOException: java.lang.NullPointerException
> Caused by: java.lang.NullPointerException
> Running
> org.apache.jackrabbit.oak.segment.migration.SegmentToExternalMigrationTest
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.163 sec <<<
> FAILURE! - in
> org.apache.jackrabbit.oak.segment.migration.SegmentToExternalMigrationTest
> blobsExistsOnTheNewBlobStore(org.apache.jackrabbit.oak.segment.migration.SegmentToExternalMigrationTest)
> Time elapsed: 0.062 sec <<< ERROR!
> java.io.IOException: java.lang.NullPointerException
> Caused by: java.lang.NullPointerException
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)