Как исправить недопустимое хранение данных на неопределенное время?

У меня есть приложение, которое использует Modeshape (версия 4.2.0.Final) и Infinispan (версия 6.0.2.Final). Во время недавнего простоя кажется, что мое бесконечное хранилище сломалось, потому что теперь я не могу получить данные из этого хранилища с такими исключениями, как

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]

Мой бесконечный кластер настроен с использованием этого 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>

как упоминалось ранее, все вышло из строя во время простоя, но как я могу восстановить это хранилище данных?

1 ответ

Решение

Там нет fsck-как инструмент для несогласованного хранения. Тем не менее, формат хранилища отдельных файлов довольно прост (см. https://github.com/infinispan/infinispan/blob/6.0.x/core/src/main/java/org/infinispan/persistence/file/SingleFileStore.java), чтобы вы могли написать свой собственный читатель и проанализировать, что не так.

Другие вопросы по тегам