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

The "missing" node cache value breaks the DocumentNodeStore#applyChanges

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.10
    • Fix Version/s: 1.7.2, 1.8.0, 1.4.22, 1.6.13
    • Component/s: documentmk
    • Labels:
      None

      Description

      In the DocumentNodeStore#nodeCache, the special object missing is being used to mark the node entries that don't exists in the repository.

      This object should be unwrapped to null every time we call nodeCache#getIfPresent() method. It's not the case in the applyChanges() method - as a result, we may get a NPE (since the missing.getLastRev() == null):

      Caused by: java.lang.NullPointerException: null
      	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:192)
      	at org.apache.jackrabbit.oak.plugins.document.PathRev.<init>(PathRev.java:40)
      	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.applyChanges(DocumentNodeStore.java:1171)
      	at org.apache.jackrabbit.oak.plugins.document.Commit.applyToCache(Commit.java:667)
      	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$3.headOfQueue(DocumentNodeStore.java:674)
      	at org.apache.jackrabbit.oak.plugins.document.CommitQueue.waitUntilHeadOfQueue(CommitQueue.java:240)
      	at org.apache.jackrabbit.oak.plugins.document.CommitQueue.done(CommitQueue.java:92)
      	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.done(DocumentNodeStore.java:668)
      

      (taken from the production instance running the Oak 1.4.10).

      //cc: Chetan Mehrotra, Marcel Reutegger, Vikas Saurabh

        Attachments

        1. OAK-6294.patch
          2 kB
          Tomek Rękawek
        2. OAK-6294-2.patch
          3 kB
          Marcel Reutegger
        3. OAK-6294-3.patch
          3 kB
          Marcel Reutegger

          Issue Links

            Activity

              People

              • Assignee:
                tomek.rekawek Tomek Rękawek
                Reporter:
                tomek.rekawek Tomek Rękawek
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: