0

我在我的 Spring Boot 项目中使用 JackRabbit 橡木实现。我的应用程序在 jcr 存储库中创建了多个节点,并集成了 PostgreSQL 数据库。jcr 存储库中已经有大量的节点数据可用。

但是,每当我启动/重新启动我的应用程序时,我都会经常收到以下日志。

{"@timestamp":"2020-05-13T13:33:06.721+05:30","@version":1,"message":"Slow Query Report SQL=select ID, MODIFIED, MODCOUNT, CMODCOUNT, HASBINARY, DELETEDONCE, VERSION, SDTYPE, SDMAXREVTIME, DATA, BDATA from DB_NODES where ID > ? and MODIFIED >= ? order by ID FETCH FIRST 100 ROWS ONLY; time=10963 ms;","logger_name":"org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport","thread_name":"main","level":"WARN","level_value":30000}
{"@timestamp":"2020-05-13T13:33:06.998+05:30","@version":1,"message":"Long running query on mango_NODES with 100 hits (limited to 100), elapsed time 11238ms (configured QUERYTIMELIMIT 10000), params minid '5:/oak:index/nodetype/:index/spr%3Atask/id1' maxid 'null' excludeKeyPatterns [] conditions [_modified >= 1584429305] limit 100. Result range: '5:/oak:index/nodetype/:index/spr%3Atask/id1'...'5:/oak:index/spr_task_jcr_created/:index/2019-05-03T04%3A31%3A29.882Z/id3'. Read 20094 chars from DATA and 0 bytes from BDATA. Check calling method.","logger_name":"org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStoreJDBC","thread_name":"main","level":"INFO","level_value":20000,"stack_trace":"java.lang.Exception: call stack\r\n\tat org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStoreJDBC.query(RDBDocumentStoreJDBC.java:522)\r\n\tat org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.internalQuery(RDBDocumentStore.java:1769)\r\n\tat org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.query(RDBDocumentStore.java:297)\r\n\tat org.apache.jackrabbit.oak.plugins.document.util.Utils$2$1.nextBatch(Utils.java:684)\r\n\tat org.apache.jackrabbit.oak.plugins.document.util.Utils$2$1.computeNext(Utils.java:668)\r\n\tat org.apache.jackrabbit.oak.plugins.document.util.Utils$2$1.computeNext(Utils.java:658)\r\n\tat com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)\r\n\tat com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)\r\n\tat com.google.common.collect.Iterators$7.computeNext(Iterators.java:650)\r\n\tat com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)\r\n\tat com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)\r\n\tat com.google.common.collect.TransformedIterator.hasNext(TransformedIterator.java:43)\r\n\tat com.google.common.collect.Iterators$7.computeNext(Iterators.java:650)\r\n\tat com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)\r\n\tat com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)\r\n\tat com.google.common.collect.Iterators$6.hasNext(Iterators.java:617)\r\n\tat org.apache.jackrabbit.oak.plugins.document.NodeDocumentSweeper.performSweep(NodeDocumentSweeper.java:152)\r\n\tat org.apache.jackrabbit.oak.plugins.document.NodeDocumentSweeper.sweep(NodeDocumentSweeper.java:122)\r\n\tat org.apache.jackrabbit.oak.plugins.document.LastRevRecoveryAgent.recover(LastRevRecoveryAgent.java:244)\r\n\tat org.apache.jackrabbit.oak.plugins.document.LastRevRecoveryAgent.recover(LastRevRecoveryAgent.java:195)\r\n\tat org.apache.jackrabbit.oak.plugins.document.LastRevRecoveryAgent.recoverCandidates(LastRevRecoveryAgent.java:533)\r\n\tat org.apache.jackrabbit.oak.plugins.document.LastRevRecoveryAgent.recover(LastRevRecoveryAgent.java:161)\r\n\tat org.apache.jackrabbit.oak.plugins.document.RecoveryHandlerImpl.recoverInternal(RecoveryHandlerImpl.java:74)\r\n\tat org.apache.jackrabbit.oak.plugins.document.RecoveryHandlerImpl.recover(RecoveryHandlerImpl.java:57)\r\n\tat org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfo.createInstance(ClusterNodeInfo.java:565)\r\n\tat org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfo.getInstance(ClusterNodeInfo.java:438)\r\n\tat org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.<init>(DocumentNodeStore.java:554)\r\n\tat org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBuilder.build(DocumentNodeStoreBuilder.java:174)\r\n\tat com.cms.common.helper.RepositoryUtil.createRepo(RepositoryUtil.java:119)\r\n\tat com.cms.common.helper.RepositoryUtil.createRepo(RepositoryUtil.java:138)\r\n\tat com.cms.common.helper.RepositoryUtil.getRepository(RepositoryUtil.java:217)\r\n\tat com.cms.common.helper.RepositoryUtil.getSession(RepositoryUtil.java:231)\r\n\tat com.cms.services.RepositoryInitialization.createCustomNode(RepositoryInitialization.java:39)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:366)\r\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:311)\r\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:134)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:407)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1622)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)\r\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756)\r\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)\r\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)\r\n\tat org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:123)\r\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:666)\r\n\tat org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:353)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:300)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1082)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1071)\r\n\tat com.cms.services.CMSServicesApplication.main(CMSServicesApplication.java:36)\r\n"}
{"@timestamp":"2020-05-13T13:33:26.999+05:30","@version":1,"message":"Sweep on cluster node [4]: 24501 nodes scanned in 7.799 min (~3141/m) - last interval 4500 nodes in 60.27 s (~4479/m)","logger_name":"org.apache.jackrabbit.oak.plugins.document.NodeDocumentSweeper","thread_name":"main","level":"INFO","level_value":20000}
{"@timestamp":"2020-05-13T14:24:58.069+05:30","@version":1,"message":"Recovery for cluster node [4]: 4701 nodes scanned in 60.38 s (~4671/m) - last interval 4701 nodes in 60.38 s (~4671/m)","logger_name":"org.apache.jackrabbit.oak.plugins.document.LastRevRecoveryAgent","thread_name":"main","level":"INFO","level_value":20000}

似乎所有节点都从存储库中扫描,因此应用程序需要很长时间才能启动。有什么方法可以快速启动应用程序,还是我需要在我的 jcr 实现中进行任何实现更改?

4

1 回答 1

0

如果您在未正确关闭存储库的情况下关闭存储库,则会发生这种情况。

启动时,系统将扫描未完成的提交。这可能需要很长时间,具体取决于节点的数量,以及您的版本是否对https://issues.apache.org/jira/browse/OAK-8002进行了更改。

于 2020-05-13T10:24:01.393 回答