Eviction is in memory only unfortunately. Only expiration is persisted in a store.
Don't know if I made myself clear.
Which entry was least recently put is apparently persisted and respected by eviction even after a restart:
put key A
put key B
put key C
put key A
additional puts that lead to eviction -> Entries are evicted in order B,C,A
Just not which entry was least recently used:
put key A, B, C in that order
get key B
get key C
get key A
additional puts that lead to eviction -> Entries are evicted in order A,B,C
Will is absolutely correct, eviction is only based on accesses and updates to entries in memory.
Simple tests that only insert a bunch of entries and restart the cache may work, but that doesn't mean it's going to keep working in more complex scenarios, for instance if you remove some of the entries and replace others. Sorry, but there just isn't any code in Infinispan to persist LRU/LIRS information on disk.
I understand this behaviour is accidental rather than deliberate and probably doesn't scale, but for the record even with a unit test that puts 1000 entries, removes 25% of them and then replaces every second entry of the remaining I couldn't get it to mix up the order of least recent write access after a restart.
Either way, thank you for answering my initial question.