Hazelcast近缓存逐出不起作用 [英] Hazelcast near-cache eviction doesn't work

查看:186
本文介绍了Hazelcast近缓存逐出不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Hazelcast 3.7.4,并且我同时具有lite和non-lite成员.

I'm using Hazelcast 3.7.4, and I have both lite and non-lite members.

在我的精简版成员上,我将近缓存设置如下:

On my lite members I'm setting near-cache as follows:

        NearCacheConfig nearCacheConfig = new NearCacheConfig(0, cacheSize, EvictionPolicy.LRU.name(), 0, true, InMemoryFormat.OBJECT);
        config.getMapConfig(mapName).setNearCacheConfig(nearCacheConfig);

我已在lite成员上配置了条目侦听器,并可以验证它是否在更改时被调用.而且,旧值内容和新值内容都是正确的.

I have configured entry listener on my lite member and could verify that it is called on change. Moreover, the old and new value content is correct.

但是当我试图从地图上获取价值时,我仍然在获取旧价值.

But when I'm trying to get the value from the map I'm still getting the old value.

在调试时,我尝试查看地图内容,可以看到新值,但是当我调用:map.get(key)时,将返回旧值.

While debugging, I've tried to look at the map content and I could see the new value, but when I'm calling: map.get(key) the old value is returned.

推荐答案

这显然是一个错误,是我从HZ团队得到的答案:

That's apparently a bug, the answer I got from HZ team:

感谢您报告此错误,确实这是3.7版本的错误. 3.8-EA没有这个问题. 问题的根本原因是,如果在其他成员上也未配置近乎缓存,则不会将无效消息发送给精简成员.

Thanks for reporting this, indeed it is a bug for 3.7 version. 3.8-EA don't have this issue. Root cause of the issue is invalidations are not sent to lite-members if near cache is not configured also on other members.

目前,作为一种变通办法,您可以在其他成员上启用Near缓存. 可能我们可以在下一个3.7补丁程序版本中解决此问题,该补丁程序将是 3.7.6.

For now, as a workaround you can enable near cache on other members. Possibly we can fix this issue in next 3.7 patch release which will be 3.7.6.

作为一种变通方法,如建议的那样,我已在其他成员上启用了近缓存(仅针对此地图),并且此问题得以解决.

As a workaround, as suggested, I've enabled near cache on the other members (only for this map) and it solved the problem.

https://github.com/hazelcast/hazelcast/issues/9723

这篇关于Hazelcast近缓存逐出不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆