ignite: java.lang.IndexOutOfBoundsException + Failed to wait for completion of partition map exchang

Posted cord

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ignite: java.lang.IndexOutOfBoundsException + Failed to wait for completion of partition map exchang相关的知识,希望对你有一定的参考价值。

异常描述:

2018-06-06 14:24:02.932 ERROR 17364 --- [ange-worker-#42] .c.d.d.p.GridDhtPartitionsExchangeFuture : Failed to reinitialize local partitions (preloading will be stopped): 
    ...
java.lang.IndexOutOfBoundsException: index 678
    ... org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:2279) [ignite-core-2.3.0.jar:2.3.0]
    at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110) [ignite-core-2.3.0.jar:2.3.0]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_73]

2018-06-06 14:24:02.932  INFO 17364 --- [ange-worker-#42] .c.d.d.p.GridDhtPartitionsExchangeFuture : Finish exchange future [startVer=AffinityTopologyVersion [topVer=1, minorTopVer=1], resVer=null, err=java.lang.IndexOutOfBoundsException: index 678]
2018-06-06 14:24:02.941 ERROR 17364 --- [ange-worker-#42] .i.p.c.GridCachePartitionExchangeManager : Failed to wait for completion of partition map exchange (preloading will not start): GridDhtPartitionsExchangeFuture 
...
org.apache.ignite.IgniteCheckedException: index 678
    at org.apache.ignite.internal.util.IgniteUtils.cast(IgniteUtils.java:7252) ~[ignite-core-2.3.0.jar:2.3.0]
    ....
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:2279) ~[ignite-core-2.3.0.jar:2.3.0]
    ... 2 common frames omitted

出现这个情况的原因如下:

如果定义的缓存类型是REPLICATED模式,并且开启了持久化,后面将其改为PARTITIONED模式,并导入数据,后续重启的时候就会报这个错误。

比如下面这种情况:

default-config.xml

        <property name="cacheConfiguration">
            <list>
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                  ...
                    <property name="name" value="Test"/>
                    <property name="atomicityMode" value="ATOMIC"/>
                    <property name="cacheMode" value="REPLICATED"/>
                  ...
                </bean>
            </list>
        </property>
        ignite.destroyCache("Test");
        IgniteCache<Long, CommRate> cache = ignite.getOrCreateCache("Test");

当重新启动的时候,default-config.xml中的配置先生效,所以会出现这个问题。

解决办法就是在持久化模式下不要更改缓存模式,或者不要在配置文件中预定义缓存类型。

I can‘t reproduce your case. But the issue could occur if you had a REPLICATED cache and after some time changed it to PARTITIONED and for example call to getOrCreateCache keeping old cache name.

参考链接:

http://apache-ignite-users.70518.x6.nabble.com/Weird-index-out-bound-Exception-td14905.html

以上是关于ignite: java.lang.IndexOutOfBoundsException + Failed to wait for completion of partition map exchang的主要内容,如果未能解决你的问题,请参考以下文章

Ignite 性能:如何调整 ignite 瘦客户端的缓存写入性能?

Apache Ignite 学习

Java/Ignite - Try 块的功能 [重复]

Apache Zeppelin 与 Ignite 集成时出现“无法启动 Ignite 节点”错误

apache ignite系列:使用ddl和dml脚本初始化ignite并使用mybatis查询缓存

在命令行上运行 Apache Ignite 时创建 Ignite 组件失败