首页 > 解决方案 > Apache Ignite:无法将数据插入持久缓存,因为拓扑版本的亲和性未初始化

问题描述

我正在尝试使用瘦 .NET 客户端将数据插入持久数据区域,并且在我调用 PutAllAsync 方法后,ignite 进程因以下错误而终止:

[15:45:09,616][SEVERE][exchange-worker-#66][] JVM will be halted immediately due to the failure: [failureCtx=FailureContext [type=SYSTEM_WORKER_TERMINATION, err=class o.a.i.IgniteCheckedException: Affinity for topology version is not initialized [locNode=8fda194c-c82f-4d52-80b0-24ac1d7c8be7, grp=ignite-sys-cache, topVer=AffinityTopologyVersion [topVer=1, minorTopVer=2], head=AffinityTopologyVersion [topVer=1, minorTopVer=1], history=[AffinityTopologyVersion [topVer=1, minorTopVer=1]]]]]

这是默认配置.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd">
    <!--
        Alter configuration below as needed.
    -->
    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
      <property name="dataStorageConfiguration">
      
        <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
            <property name="dataRegionConfigurations">
                <list>
                    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <property name="name" value="data_persistent_region"/>
                        <property name="persistenceEnabled" value="true"/>
                    </bean>
                </list>
            </property>
        </bean>
      </property>
    </bean>
</beans>

这是一个数据插入的例子:

    var cacheConfiguration = new CacheClientConfiguration(key, cacheEntity);
    cacheConfiguration.CacheMode = CacheMode.Replicated;
    cacheConfiguration.DataRegionName = "data_persistent_region";
    _igniteClient.GetOrCreateCache<int, T>(cacheConfiguration)
        .PutAll(data.Select((x, i) => new KeyValuePair<int, T>(i, x)));

尝试使用“-Djava.net.preferIPv4Stack=true”和“-DIGNITE_QUIET=false”选项,但没有帮助。

PS。我正在使用 Apache Ignite 2.10.0。如果我禁用区域持久性,一切正常。

标签: c#ignite

解决方案


似乎我发现了问题所在:缓存键包含不支持的符号“:”来创建具有相同名称的文件。


推荐阅读