how does eviction work in an infinispan replicated cache?

You will want to check out this section of the Infinispan User Guide https://infinispan.org/docs/stable/titles/configuring/configuring.html#eviction-and-expiration_configuring-memory-usage

As you mentioned eviction is done per node and removes entries that were deemed to be used the least most recently. (Note that off JVM heap and on heap have slightly different algorithms). Due to this it is possible to have some nodes with and without data if you have run out of entries. This in turn can cause inconsistencies with what each node can see.

If you need to limit memory usage, which is the main point of eviction, all you need to do to keep consistency between all nodes is to have a persistent storage defined, such as file store which is covered in the next section https://infinispan.org/docs/stable/titles/configuring/configuring.html#persistence.

Note that expiration differs from eviction in that it is done cluster wide. So if you still want data consistency across all nodes, expiration can be used instead if it is sufficient for your use case.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top