javacachinginfinispan

Infinispan cache entities are lost in production


We have infinispan cache with config (CustomCacheMaxCount is 100000): new ConfigurationBuilder().clustering() .partitionHandling().mergePolicy(MergePolicy.REMOVE_ALL) .clustering() .cacheMode(CacheMode.INVALIDATION_SYNC) .statistics().enable() .memory() .maxCount(cacheSettingsHolder.getCustomCacheMaxCount()) .whenFull(EvictionStrategy.REMOVE) After the last redeployment with some updates we noticed too slow responses. We found out that infinispan does not work properly. We have no evictions and cluster partitioning. enter image description here But we have more misses than hits enter image description here And cache size is changing. Growing and decreasing, although it shouldn't decrease because there wasn't any eviction. While L2 cache works just fine. enter image description here enter image description here

Any ideas how to find the reason of this behavior and stop this cache from losing entries?


Solution

  • Solution is to use

    Cache#putForExternalRead
    

    to prevent cache on other nodes from invalidation after Cache#put