-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation update: LRU, newest not oldest expired out in edge cases #273
Comments
@ahmetmircik can you take a quick look? |
This is expected by design. Eviction happens per-partition basis. So when map needs eviction, it sorts entries in a partition to apply LRU and removes most eligible one. In above test case, all entries go in a different partition. All the keys that are being put is the only key in matching partition. So if map decides eviction is required, it removes that only 1 entry from the partition.
Regarding time resolution, it is in seconds after 3.11. |
From https://docs.hazelcast.com/hazelcast/5.1-snapshot/data-structures/managing-map-memory#understanding-map-eviction we would expect each partition to get a maximum size of 1. If we insert keys 4,3,2,1,0 these go to partitions 179,227,5,31,11. If we reverse the sequence, insert 0,1,2,3,4 these go to partitions 11,31,5,227,179. So the observed behaviour is newest inserts are deleted if all partitions are the same size. |
Eviction process only checks the partition of the put operation, there is no coordination between partitions. |
Thanks @ahmetmircik |
Reopened as placeholder for documentation clarification. Hazelcast is working correctly, but without understanding of the above explanation, it would seem counter-intuitive |
Newest entries are deleted not oldest, I presume as
expirationTime
is set toLong.MAX_VALUE
for allReproducer, tested on 4.2.2 and 5.0:
gives
Last access time seems also to have lost millisecond granularity.
Related hazelcast/hazelcast#18614
The text was updated successfully, but these errors were encountered: