[
https://issues.apache.org/jira/browse/OAK-7709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16596317#comment-16596317
]
Julian Reschke commented on OAK-7709:
-------------------------------------
AFAIU, the root cause here is DocumentNodeStore.dispose()'s attempt to write a
tombstone revision, which will fail with an exception upon lease failure,
causing the remaining cleanup code to be skipped.
I'll try to address this, but there may be more issues related to restart after
lease failure down the road.
> Persistent cache files locked on restart of DocumentNodeStore
> -------------------------------------------------------------
>
> Key: OAK-7709
> URL: https://issues.apache.org/jira/browse/OAK-7709
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: documentmk
> Affects Versions: 1.8.2
> Environment: * Linux
> * IBM JDK 8
> Reporter: Jörg Hoh
> Priority: Major
>
> During a maintenance of our database system the DocumentNodeStore bundle shut
> down because of a lease timeout. When we restart the bundle, we ran into
> these exceptions:
> {code}
> 16.08.2018 11:32:44.139 *INFO* [Default Executor-thread-20544]
> org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService
> Configuring persistent cache to only cache nodes under paths [/libs, /apps,
> /jcr:system/jcr:nodeTypes, /jcr:system/rep:namespaces]
> 16.08.2018 11:32:44.155 *INFO* [Default Executor-thread-20544]
> org.apache.jackrabbit.oak.plugins.document.persistentCache.PersistentCache
> start, url=/opt/aem/repository/sling/_cqa/cache,size=2048,binary=0
> 16.08.2018 11:32:44.156 *WARN* [Default Executor-thread-20544]
> org.apache.jackrabbit.oak.plugins.document.persistentCache.MapFactory Error
> in the background thread of the persistent cache:
> java.lang.IllegalStateException: The file is locked:
> nio:/opt/aem/repository/sling/_cqa/cache/cache-0.data [1.4.194/7]
> 16.08.2018 11:32:44.157 *WARN* [Default Executor-thread-20544]
> org.apache.jackrabbit.oak.plugins.document.persistentCache.MapFactory Could
> not open the store /opt/aem/repository/sling/_cqa/cache/cache-0.data
> java.lang.IllegalStateException: The file is locked:
> nio:/opta/aem/repository/sling/_cqa/cache/cache-0.data [1.4.194/7]
> at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:765)
> at org.h2.mvstore.FileStore.open(FileStore.java:168)
> at org.h2.mvstore.MVStore.<init>(MVStore.java:347)
> at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2930)
> at
> org.apache.jackrabbit.oak.plugins.document.persistentCache.PersistentCache$1.openStore(PersistentCache.java:288)
> at
> org.apache.jackrabbit.oak.plugins.document.persistentCache.PersistentCache.createMapFactory(PersistentCache.java:361)
> at
> org.apache.jackrabbit.oak.plugins.document.persistentCache.PersistentCache.<init>(PersistentCache.java:210)
> at
> org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBuilder.getPersistentCache(DocumentNodeStoreBuilder.java:648)
> at
> org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBuilder.buildCache(DocumentNodeStoreBuilder.java:627)
> at
> org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBuilder.buildDocumentCache(DocumentNodeStoreBuilder.java:586)
> at
> org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBuilder.buildNodeDocumentCache(DocumentNodeStoreBuilder.java:594)
> at
> org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.initialize(RDBDocumentStore.java:967)
> {code}
> It seems that the mvstore wasn't shut down properly during the stop of the
> DocumentNodeStore. For me it seems that the DocumentNodeStore doesn't use the
> persistent cache anymore until there was a "hard" restart (on the JVM).
> It would be good if even in this situation the shutdown of the
> DocumentNodeStore could drop the lock on the mvstore, so a clean restart of
> the bundle is possible.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)