Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-1753

Calling initializer after InitialContent.initialize() on a DocumentRootBuilder fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0
    • core
    • None

    Description

      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.

      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)
      

      Attachments

        1. OAK-1753.patch
          4 kB
          Amit Jain

        Issue Links

          Activity

            People

              mreutegg Marcel Reutegger
              amitjain Amit Jain
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: