Amit Jain created OAK-1753:
------------------------------
Summary: Calling initializer after InitialContent.initialize() on
a DocumentRootBuilder fails
Key: OAK-1753
URL: https://issues.apache.org/jira/browse/OAK-1753
Project: Jackrabbit Oak
Issue Type: Bug
Components: core
Reporter: Amit Jain
Calling an initializer after calling InitialContent.initialize() fails when
working with the DocumentNodeStore.
Same test passes on a SegmentNodeStore or when the InitialContent.initialize()
is not called.
Attached a test case patch which simulates the above condition. The test uses a
UserInitializer to initialize the default users - admin & anonymous. The above
failure causes problems when upgrading from a JR2 repository to oak using the
{{RepositoryUpgrade}} class.
The stack trace from the test is as below.
{code}
org.apache.jackrabbit.mk.api.MicroKernelException: The node 1:/home was already
added in revision
r1458906b9a2-0-1, before
r1458906e9a1-0-1; document:
{_id=1:/home,
_modified=1398163290,
_modCount=1,
_commitRoot={r1458906b9a2-0-1=0},
_children=true,
_deleted={r1458906b9a2-0-1=false},
jcr:primaryType={r1458906b9a2-0-1="nam:rep:AuthorizableFolder"}},
revision order:
1:
r1458902f08c-0-1:r1458902f0a3-0-0
at
org.apache.jackrabbit.oak.plugins.document.Commit.checkConflicts(Commit.java:533)
at
org.apache.jackrabbit.oak.plugins.document.Commit.createOrUpdateNode(Commit.java:451)
at
org.apache.jackrabbit.oak.plugins.document.Commit.applyToDocumentStore(Commit.java:336)
at
org.apache.jackrabbit.oak.plugins.document.Commit.prepare(Commit.java:213)
at
org.apache.jackrabbit.oak.plugins.document.Commit.apply(Commit.java:182)
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.persist(DocumentNodeStoreBranch.java:173)
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.persist(DocumentNodeStoreBranch.java:85)
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.persist(DocumentNodeStoreBranch.java:1)
at
org.apache.jackrabbit.oak.spi.state.AbstractNodeStoreBranch$Persisted.persistTransientHead(AbstractNodeStoreBranch.java:621)
at
org.apache.jackrabbit.oak.spi.state.AbstractNodeStoreBranch$Persisted.setRoot(AbstractNodeStoreBranch.java:564)
at
org.apache.jackrabbit.oak.spi.state.AbstractNodeStoreBranch.setRoot(AbstractNodeStoreBranch.java:219)
at
org.apache.jackrabbit.oak.plugins.document.DocumentRootBuilder.purge(DocumentRootBuilder.java:196)
at
org.apache.jackrabbit.oak.plugins.document.DocumentRootBuilder.getNodeState(DocumentRootBuilder.java:107)
at
org.apache.jackrabbit.oak.plugins.document.InitializerTest.testInitializerMongo(InitializerTest.java:33)
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)