[ 
https://issues.apache.org/jira/browse/OAK-6294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16050085#comment-16050085
 ] 

Marcel Reutegger commented on OAK-6294:
---------------------------------------

OK, then this shouldn't be caused by OAK-4518. I also skimmed through the 
issues fixed since 1.4 and couldn't find a known problem that matches this 
issue. I understand, this issue is difficult to reproduce and my own tests that 
simulate the operations as seen in the data you provided were all successful.

I suggest we go with the 'temporary' fix Tomek proposed, but add some logging 
that gives additional information when it happens. It may also be useful to 
invalidate the affected cache entries. Even though the proposed changes do not 
address the issue directly, they are still important because the NPE breaks the 
commit logic. At that point, the commit was successfully written to the 
storage. But with the exception some in-memory data structures are not updated.

> The "missing" node cache value breaks the DocumentNodeStore#applyChanges
> ------------------------------------------------------------------------
>
>                 Key: OAK-6294
>                 URL: https://issues.apache.org/jira/browse/OAK-6294
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: documentmk
>    Affects Versions: 1.4.10
>            Reporter: Tomek Rękawek
>              Labels: candidate_oak_1_4, candidate_oak_1_6
>             Fix For: 1.8, 1.7.2
>
>         Attachments: OAK-6294.patch
>
>
> 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}}):
> {noformat}
> 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)
> {noformat}
> (taken from the production instance running the Oak 1.4.10).
> //cc: [~chetanm], [~mreutegg], [~catholicon]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to