使用putall时,coherence不会备份条目

时间:2014-05-21 08:21:16

标签: caching in-memory-database oracle-coherence

我使用coherence来缓存一些数据。缓存是分区的,在堆外并配置为在另一个节点上备份条目。因此,当我有2个节点并关闭其中一个节点时,高速缓存大小不得减小,并且必须从备份恢复关闭节点上的数据。当我使用namedcache.put方法向缓存添加条目时,这种情况很好。我的问题是,当我使用namedcache.putall时,条目不备份,当我关闭一个节点时,该节点上的条目从缓存中删除。

更新1:使用堆外模式时存在此问题。在堆模式下,不存在任何问题。

二手缓存方案如下:

<distributed-scheme>
    <scheme-name>history-map</scheme-name>
    <service-name>HistoryMap</service-name>
    <serializer>
        <instance>
            <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
            <init-params>
                <init-param>
                    <param-type>String</param-type>
                    <param-value>pof-config.xml</param-value>
                </init-param>
            </init-params>
        </instance>
    </serializer>

    <thread-count>10</thread-count>
    <local-storage>true</local-storage>
    <partition-count>100</partition-count>
    <backup-count>1</backup-count>
    <backup-storage>
        <type>off-heap</type>
        <initial-size>1MB</initial-size>
        <maximum-size>50MB</maximum-size>
    </backup-storage>

    <backing-map-scheme>
        <partitioned>true</partitioned>
        <external-scheme>
            <nio-memory-manager>
                <initial-size>1MB</initial-size> 
                <maximum-size>50MB</maximum-size>
            </nio-memory-manager>
            <high-units>125</high-units>
            <unit-calculator>BINARY</unit-calculator>
            <unit-factor>1048576</unit-factor>
        </external-scheme>
    </backing-map-scheme>           
    <autostart>true</autostart>         
</distributed-scheme>

2 个答案:

答案 0 :(得分:1)

  1. 如果您使用的是Coherence 3.7或更高版本,则应使用&#34;弹性数据&#34;功能而不是NIO。它具有大多数(如果不是全部)相同的好处,但速度更快,密度更高,更易于配置和使用。

  2. 支持地图本身不应该影响备份处理,所以我不清楚为什么你会看到你所描述的问题类型。你在运行什么版本的Coherence?

答案 1 :(得分:0)

我可以重现这个问题,并为此问题创建了一个错误。我们在为SerializationMap填充backingMapEvent时遇到了一个错误,导致条目无法正确备份 问题应尽快解决。