gpt4 book ai didi

java - 如何修复无效的 infinispan 数据存储?

转载 作者:行者123 更新时间:2023-12-01 10:26:31 25 4
gpt4 key购买 nike

我有一个使用 Modeshape(版本 4.2.0.Final)和 Infinispan(版本 6.0.2.Final)的应用程序。在最近的一次中断期间,我的 infinispan 存储似乎崩溃了,因为我现在无法从此存储中获取任何数据,但存在以下异常:

Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to org.infinispan.metadata.InternalMetadata
at org.infinispan.marshall.core.MarshalledEntryImpl.getMetadata(MarshalledEntryImpl.java:72) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.CacheLoaderInterceptor.loadIfNeeded(CacheLoaderInterceptor.java:266) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.CacheLoaderInterceptor.loadIfNeededAndUpdateStats(CacheLoaderInterceptor.java:335) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.CacheLoaderInterceptor.visitGetKeyValueCommand(CacheLoaderInterceptor.java:105) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.visitGetKeyValueCommand(EntryWrappingInterceptor.java:116) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:112) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:74) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.visitGetKeyValueCommand(AbstractTxLockingInterceptor.java:60) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitGetKeyValueCommand(OptimisticLockingInterceptor.java:108) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:112) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:74) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:226) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:221) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:92) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:110) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:73) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:74) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:333) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.CacheImpl.get(CacheImpl.java:377) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.CacheImpl.get(CacheImpl.java:369) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
at org.infinispan.schematic.internal.CacheSchematicDb.get(CacheSchematicDb.java:72) ~[modeshape-schematic-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.cache.document.LocalDocumentStore.get(LocalDocumentStore.java:71) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.cache.document.WorkspaceCache.documentFor(WorkspaceCache.java:180) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.cache.document.WorkspaceCache.documentFor(WorkspaceCache.java:199) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.cache.document.WorkspaceCache.getNode(WorkspaceCache.java:231) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.cache.document.AbstractSessionCache.getNode(AbstractSessionCache.java:240) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.cache.document.WritableSessionCache.getNode(WritableSessionCache.java:161) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.cache.RepositoryCache$RepositoryFeaturesDetector.<init>(RepositoryCache.java:684) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.cache.RepositoryCache.<init>(RepositoryCache.java:314) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1139) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:978) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:387) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:651) ~[modeshape-jcr-4.2.0.Final.jar:4.2.0.Final]

我的 infinispan 集群是使用此 XML 配置的

<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd"
xmlns="urn:infinispan:config:6.0">

<namedCache name="myApp">
<persistence passivation="false">
<singleFile
fetchPersistentState="false"
location="../myApp-data/jcr-data"
ignoreModifications="false"
preload="false"
purgeOnStartup="false"
shared="false"
/>
</persistence>
<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.DummyTransactionManagerLookup"
transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC"/>
</namedCache>
</infinispan>

如前所述,在中断期间所有数据都崩溃了,但是我如何恢复此数据存储?

最佳答案

没有类似 fsck 的工具来处理不一致的存储。不过,单个文件存储的格式非常简单(查看 https://github.com/infinispan/infinispan/blob/6.0.x/core/src/main/java/org/infinispan/persistence/file/SingleFileStore.java ),因此您可以编写自己的阅读器并分析问题所在。

关于java - 如何修复无效的 infinispan 数据存储?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35333392/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com