You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Stefan Egli (JIRA)" <ji...@apache.org> on 2015/09/08 17:51:46 UTC

[jira] [Commented] (OAK-3373) Observers dont survive store restart (was: LuceneIndexProvider: java.lang.IllegalStateException: open)

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

Stefan Egli commented on OAK-3373:
----------------------------------

In {{DocumentNodeState.compareAgainstBaseState}} there is already a check for [{{if (store == mBase.store)}}|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java#L335] - which will be {{false}} in case of a store restart.

One way to solve the failing-observers-after-restart-problem would be to do something along the following lines (right before the above {{if}}):
{code}
if (store != mBase.store && mBase.store.isDisposed()) {
    mBase = mBase.clone(); //...
    mBase.store = store;
}
{code}
so basically convert the state which points to a disposed, old store into a state which points to the new store.

[~chetanm], [~mreutegg], [~reschke], wdyt? .. and what is the above mentioned {{if}} used for?

> Observers dont survive store restart (was: LuceneIndexProvider: java.lang.IllegalStateException: open)
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OAK-3373
>                 URL: https://issues.apache.org/jira/browse/OAK-3373
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.3.5
>            Reporter: Stefan Egli
>
> The following exception occurs when stopping, then immediately re-starting the oak-core bundle (which was done as part of testing for OAK-3250 - but can be reproduced independently). It's not clear what the consequences are though..
> {code}08.09.2015 14:20:26.960 *ERROR* [oak-lucene-0] org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProvider Uncaught exception in org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProvider@3a4a6c5c
> org.apache.jackrabbit.oak.plugins.document.DocumentStoreException: Error occurred while fetching children for path /oak:index/authorizables
>         at org.apache.jackrabbit.oak.plugins.document.DocumentStoreException.convert(DocumentStoreException.java:48)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.getChildren(DocumentNodeStore.java:902)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.getChildNodes(DocumentNodeStore.java:1082)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeState.getChildNodeEntries(DocumentNodeState.java:508)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeState.access$100(DocumentNodeState.java:65)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeState$ChildNodeEntryIterator.fetchMore(DocumentNodeState.java:716)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeState$ChildNodeEntryIterator.<init>(DocumentNodeState.java:681)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeState$1.iterator(DocumentNodeState.java:289)
>         at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:129)
>         at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:303)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeState.compareAgainstBaseState(DocumentNodeState.java:359)
>         at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)
>         at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:140)
>         at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:303)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeState.compareAgainstBaseState(DocumentNodeState.java:359)
>         at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)
>         at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:140)
>         at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:303)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeState.compareAgainstBaseState(DocumentNodeState.java:359)
>         at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52)
>         at org.apache.jackrabbit.oak.plugins.index.lucene.IndexTracker.update(IndexTracker.java:108)
>         at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProvider.contentChanged(LuceneIndexProvider.java:73)
>         at org.apache.jackrabbit.oak.spi.commit.BackgroundObserver$1$1.call(BackgroundObserver.java:127)
>         at org.apache.jackrabbit.oak.spi.commit.BackgroundObserver$1$1.call(BackgroundObserver.java:121)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.IllegalStateException: open
>         at org.bson.util.Assertions.isTrue(Assertions.java:36)
>         at com.mongodb.DBTCPConnector.isMongosConnection(DBTCPConnector.java:367)
>         at com.mongodb.Mongo.isMongosConnection(Mongo.java:622)
>         at com.mongodb.DBCursor._check(DBCursor.java:494)
>         at com.mongodb.DBCursor._hasNext(DBCursor.java:621)
>         at com.mongodb.DBCursor.hasNext(DBCursor.java:657)
>         at org.apache.jackrabbit.oak.plugins.document.mongo.MongoDocumentStore.queryInternal(MongoDocumentStore.java:658)
>         at org.apache.jackrabbit.oak.plugins.document.mongo.MongoDocumentStore.query(MongoDocumentStore.java:589)
>         at org.apache.jackrabbit.oak.plugins.document.mongo.MongoDocumentStore.query(MongoDocumentStore.java:561)
>         at org.apache.jackrabbit.oak.plugins.document.util.LeaseCheckDocumentStoreWrapper.query(LeaseCheckDocumentStoreWrapper.java:77)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.readChildDocs(DocumentNodeStore.java:1003)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.readChildren(DocumentNodeStore.java:933)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$6.call(DocumentNodeStore.java:885)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$6.call(DocumentNodeStore.java:882)
>         at org.apache.jackrabbit.oak.cache.CacheLIRS$Segment.load(CacheLIRS.java:1004)
>         at org.apache.jackrabbit.oak.cache.CacheLIRS$Segment.get(CacheLIRS.java:969)
>         at org.apache.jackrabbit.oak.cache.CacheLIRS.get(CacheLIRS.java:280)
>         at org.apache.jackrabbit.oak.plugins.document.persistentCache.NodeCache.get(NodeCache.java:116)
>         at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.getChildren(DocumentNodeStore.java:882)
>         ... 26 common frames omitted
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)