[
https://issues.apache.org/jira/browse/OAK-4909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15561856#comment-15561856
]
Chetan Mehrotra commented on OAK-4909:
--------------------------------------
In a running system there can be at max 2 {{IndexNode}} instances opened for
same index say /oak:index/fooIndex. The older node ( IndexNode1) is being used
by some query while newer node (IndexNode2) is being constructed via
{{IndexTracker}} as index content has changed. These 2 node can refer to 3
{{NRTIndex}} instances
* IndexNode1 - NRTIndex0, NRTIndex1 - Here NRTIndex0 is the previous NRTIndex
from older IndexNode0
* IndexNode2 - NRTIndex1, NRTIndex2 - Here NRTIndex1 is the previous NRTIndex
which would not receive any new updates while NRTIndex2 is created just now
Currently logic only accounted for one IndexNode being active hence kept max 2
NRTIndex instance opened. However given above it should keep 3 NRTIndex
instances.
Fixed this in r1764047
> NRTIndex can get closed while in use
> ------------------------------------
>
> Key: OAK-4909
> URL: https://issues.apache.org/jira/browse/OAK-4909
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: lucene
> Reporter: Chetan Mehrotra
> Assignee: Chetan Mehrotra
> Fix For: 1.6
>
>
> With hybrid indexing enabled it can happen that NRTIndex gets closed while
> its in use
> {noformat}
> 2016-10-10 14:22:41,094 WARN NA [Workflow Starter Thread]
> o.a.j.o.p.i.l.h.DocumentQueue - Error occurred while indexing index
> [/oak:index/hybridIndex] java.lang.IllegalStateException: null
> at
> com.google.common.base.Preconditions.checkState(Preconditions.java:134)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndex.createReader(NRTIndex.java:168)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndex.getPrimaryReader(NRTIndex.java:87)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndex.getReaders(NRTIndex.java:118)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.IndexNode.getNRTReaders(IndexNode.java:200)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.IndexNode.refreshReaders(IndexNode.java:172)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.IndexNode.access$000(IndexNode.java:50)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.IndexNode$1.run(IndexNode.java:84)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.RefreshOnWritePolicy.refreshOnWriteIfRequired(RefreshOnWritePolicy.java:41)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.IndexNode.refreshReadersOnWriteIfRequired(IndexNode.java:168)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.DocumentQueue.processDocs(DocumentQueue.java:210)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)