Search code examples
cachinghazelcasthazelcast-imap

TTL-Expiration on a cluster node does not update my clients NearCache


I have a cache cluster with multiple nodes containing a cache map config which is only valid for 10 minutes (TTL = 600s). Additionally I have some client nodes with near caches configured for that cache.

While debugging I see the following behaviour:

If I explicitly evict an entry in that cache on the cluster node, the corresponding near cache entry is evicted as well. (internally a DeleteOperation is performed).

If the entry is timed-out, the entry in the cluster node is removed but the entry in the near cache is still valid. So the client receives an outdated entry.

When I explicitly set a TTL for the near cache as well the cache is evicted correctly.

My expectation is that a TTL-Expiration is also propagated through the cluster and to all the near caches. Am I doing something wrong or is this behaviour by design?


Solution

  • Meanwhile we accept that behaviour as a feature and see near caches as a separate cache layer.

    From this perspective it makes sense to design it like this. So the cluster has some rules for TTL oder IdleTime but the client can have different requirements for the topicality of items.