[
https://issues.apache.org/jira/browse/OAK-6294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16036711#comment-16036711
]
Tomek Rękawek commented on OAK-6294:
------------------------------------
I investigeted this further. There's another exception, right after:
{noformat}
24.05.2017 19:33:07.793 *WARN* [pool-86-thread-1] org.apache.felix.eventadmin
Service [org.apache.sling.event.impl.jobs.queues.QueueManager,1963,
[java.lang.Runnable, org.apache.sling.event.impl.jobs.queues.QueueManager,
org.osgi.service.event.EventHandler]] EventAdmin: Exception during event
dispatch [org.osgi.service.event.Event
[topic=org/apache/sling/event/notification/job/ADDED] | [java.lang.Runnable,
org.apache.sling.event.impl.jobs.queues.QueueManager,
org.osgi.service.event.EventHandler] | Bundle(org.apache.sling.event [309])]
(org.apache.jackrabbit.oak.plugins.document.DocumentStoreException: Aborting
getChildNodes() - DocumentNodeState is null for
r15c3bea59fd-0-1,r15c3bea5163-0-2,r15c3bea521b-0-3 at
/var/eventing/jobs/assigned/70552490-658f-4788-aa1a-f76a26723684/com.adobe.elm.core.activity.sync/2017/5/24/19/23/de18d1ea-6320-452b-9095-b3a8e3f44bd1_53402.
{noformat}
Later on, there are two identical JSONs (for the cached and uncached version of
the node):
{noformat}
{
"jcr:primaryType":{
"r15c3bea59d3-0-1":null,
"r15c3bea5163-0-2":"\"nam:slingevent:Job\""
},
"_commitRoot":{
"r15c3bea59d3-0-1":"0",
"r15c3bea5163-0-2":"0"
},
"_revisions":{
"r15c3bea598c-0-1":"c"
},
"_modified":1495653830,
"_deleted":{
"r15c3bea59d3-0-1":"true",
"r15c3bea5163-0-2":"false"
},
"_modCount":4,
"_id":"12:/var/eventing/jobs/assigned/70552490-658f-4788-aa1a-f76a26723684/com.adobe.elm.core.activity.sync/2017/5/24/19/23/de18d1ea-6320-452b-9095-b3a8e3f44bd1_53402",
"_deletedOnce":true
}
{noformat}
(I've removed the properties content, they look similar to the
{{jcr:primaryType}}).
If I understand correctly, this kind of exception is a result of following
case: the {{getChildNodes}} nodes invokes {{getChildren->readChildren}}, which
returns a list including the sling job node. Later on, when the
{{getChildNodes()}} calls the {{getNode()}} on all returned children, one of
them doesn't exist anymore (it has deleted=true for the readRevision).
It's quite similar to the original exception described in the issue (we expect
there's a child node, while it doesn't exist at the given revision).
So, we have two calls:
* getChildNodes \-> getChildren \[-> readChildren -> getNode\] (methods in
brackets are only called if the child can't be found in the cache)
* getChildNodes \-> getNode
The document returned in the first call doesn't contain the _deleted: true
entry, while the one from the second call does. Is it possible that some of the
Mongo changes get replicated between these two calls?
> 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.1
>
> 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.3.15#6346)