danieln
danieln

Reputation: 4973

Hazelcast near-cache eviction doesn't work

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.

Upvotes: 1

Views: 1031

Answers (1)

danieln
danieln

Reputation: 4973

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

Upvotes: 0

Related Questions