Hi all,
We are new to Oak. We are using an Oak repository that is supported by a
MongoDB back end. The Mongo server is running continuously. We restart the Oak
repository from time to time. The startup code is this, stripped to the
essentials:
db = new MongoClient(mongoUrl, mongoPort).getDB(mongoDbName);
ns = new DocumentMK.Builder().setMongoDB(db).getNodeStore();
Jcr jcr = new Jcr(new Oak(ns));
repository = jcr.createRepository();
When we close the Oak repository we do this:
ns.dispose(); // private DocumentNodeStore ns
((RepositoryImpl)repository).shutdown();
db.getMongo().close(); // private com.mongo.DB db
The observation is that when we do the following sequence of actions:
1. Close the repository
2. Wait for a few minutes
3. Open the repository
and then try to access the contents of the repository using Session.getNodeById
we get the following exception:
org.apache.jackrabbit.oak.plugins.document.DocumentStoreException: This oak
instance failed to update the lease in time and can therefore no longer access
this DocumentNodeStore.
at
org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfo.leaseExpired(ClusterNodeInfo.java:1154)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfo.performLeaseCheck(ClusterNodeInfo.java:662)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.document.util.LeaseCheckDocumentStoreWrapper.performLeaseCheck(LeaseCheckDocumentStoreWrapper.java:59)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.document.util.LeaseCheckDocumentStoreWrapper.find(LeaseCheckDocumentStoreWrapper.java:65)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.readNode(DocumentNodeStore.java:1214)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$5.call(DocumentNodeStore.java:1011)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$5.call(DocumentNodeStore.java:1004)
~[oak-core-1.6.1.jar:1.6.1]
at
com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4739)
~[guava-16.0.jar:?]
at
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
~[guava-16.0.jar:?]
at
com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
~[guava-16.0.jar:?]
at
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
~[guava-16.0.jar:?]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
~[guava-16.0.jar:?]
at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
~[guava-16.0.jar:?]
at
com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4736)
~[guava-16.0.jar:?]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.getNode(DocumentNodeStore.java:1004)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeState.getChildNodeDoc(DocumentNodeState.java:485)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeState.getChildNode(DocumentNodeState.java:250)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.index.property.strategy.UniqueEntryStoreStrategy.count(UniqueEntryStoreStrategy.java:190)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.index.property.strategy.UniqueEntryStoreStrategy.count(UniqueEntryStoreStrategy.java:204)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexPlan.<init>(PropertyIndexPlan.java:148)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.index.property.PropertyIndex.createPlan(PropertyIndex.java:162)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.index.property.PropertyIndex.getPlan(PropertyIndex.java:145)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.index.property.PropertyIndex.getCost(PropertyIndex.java:208)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.query.QueryImpl.getBestSelectorExecutionPlan(QueryImpl.java:1035)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.query.QueryImpl.getBestSelectorExecutionPlan(QueryImpl.java:976)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.query.ast.SelectorImpl.prepare(SelectorImpl.java:280)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.query.QueryImpl.prepare(QueryImpl.java:641)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.query.QueryEngineImpl.prepareAndSelect(QueryEngineImpl.java:294)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.query.QueryEngineImpl.executeQuery(QueryEngineImpl.java:269)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.query.QueryEngineImpl.executeQuery(QueryEngineImpl.java:229)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.resolveUUID(IdentifierManager.java:352)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.resolveUUID(IdentifierManager.java:346)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.resolveUUID(IdentifierManager.java:342)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.getTree(IdentifierManager.java:137)
~[oak-core-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.getNodeByIdentifier(SessionDelegate.java:457)
~[oak-jcr-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.jcr.session.SessionImpl$5.perform(SessionImpl.java:322)
~[oak-jcr-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.jcr.session.SessionImpl$5.perform(SessionImpl.java:318)
~[oak-jcr-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:208)
~[oak-jcr-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.jcr.session.SessionImpl.getNodeById(SessionImpl.java:318)
~[oak-jcr-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.jcr.session.SessionImpl$5.perform(SessionImpl.java:322)
~[oak-jcr-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.jcr.session.SessionImpl$5.perform(SessionImpl.java:318)
~[oak-jcr-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:208)
~[oak-jcr-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.jcr.session.SessionImpl.getNodeById(SessionImpl.java:318)
~[oak-jcr-1.6.1.jar:1.6.1]
at
org.apache.jackrabbit.oak.jcr.session.SessionImpl.getNodeByIdentifier(SessionImpl.java:340)
~[oak-jcr-1.6.1.jar:1.6.1]
How can we avoid this exception happening?
Mike Harrison
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the
property of Persistent Systems Ltd. It is intended only for the use of the
individual or entity to which it is addressed. If you are not the intended
recipient, you are not authorized to read, retain, copy, print, distribute or
use this message. If you have received this communication in error, please
notify the sender and delete all copies of this message. Persistent Systems
Ltd. does not accept any liability for virus infected mails.