Search code examples
infinispaninfinispan-10

Why is "ISPN000312: Lost data because of graceful leaver" a warning for an INVALIDATION_SYNC cache


I am using embedded Infinispan 10.1.8 and I have a clustered cache in INVALIDATION_SYNC mode. The cache is backed by another data store which is rarely updated which is why it's in that mode.

When a server leaves the cluster, Infinispan logs a message like this:

[Context=<cache name>] ISPN000312: Lost data because of graceful leaver <address>

Whatever was in the cache on that server is lost from memory, but since it is an invalidation cache I don't see why this would be a warning.

Is the warning unnecessary, or am I misunderstanding something about how this caching works?


Solution

  • I think the warning in invalidation mode only makes sense when you use the mode in a way that does not make sense.

    This cache mode only makes sense if you have another, permanent store for your data such as a database and are only using Infinispan as an optimization in a read-heavy system, to prevent hitting the database for every read.

    Source: https://infinispan.org/docs/dev/titles/configuring/configuring.html#invalidation-configuring

    When you have such a permanent store, you effectively just loose the information in what state the cache was regarding the "lost" but easily recoverable segment.

    The warning is always logged when a cache segment is not backed by any node anymore: https://github.com/infinispan/infinispan/blob/10.1.8.Final/core/src/main/java/org/infinispan/partitionhandling/impl/PreferAvailabilityStrategy.java#L54 https://github.com/infinispan/infinispan/blob/10.1.8.Final/core/src/main/java/org/infinispan/topology/ClusterTopologyManagerImpl.java#L785

    When you use a replicated cache that is not backed by a permanent store, you really loose data. I can't think of a situation where the warning makes sense in invalidation mode. I think in this case the warning should be removed because it is irritating.