Hazelcast near-cache eviction doesn't work

喜欢而已 提交于 2019-12-24 07:26:44

问题


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);

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.

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.


回答1:


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

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.

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



来源:https://stackoverflow.com/questions/41789904/hazelcast-near-cache-eviction-doesnt-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!