Skip to content
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

Getting null for newly added elements in Cache. #7634

Closed
kuldeep9922 opened this issue Mar 1, 2016 · 4 comments · Fixed by #8279
Closed

Getting null for newly added elements in Cache. #7634

kuldeep9922 opened this issue Mar 1, 2016 · 4 comments · Fixed by #8279

Comments

@kuldeep9922
Copy link

Here's the map configuration:

<hz:map name="cacheName"
                    backup-count="1"
                    max-size="10000"
                    eviction-percentage="0"
                    read-backup-data="true"
                    eviction-policy="LRU"
                    merge-policy="com.hazelcast.map.merge.LatestUpdateMapMergePolicy"
                    time-to-live-seconds="0"
                    >
</hz:map>

After reaching max-size of 10000, it starts return null object for newly added values in cache. There seems to be some problem with eviction in hazel-cast. How can I fetch newly added values?

@ahmetmircik
Copy link
Member

Hi @kuldeep9922,

This is a known issue #4334 and scheduled to fix in 3.7. As a workaround you can increase eviction-percentage to a higher number (for example 25) and listen local entry evicted events if the evicted key is a fresh key, you can try to put it again into IMap. (Btw, i didn't try this workaround, only i thought it may work)

@kuldeep9922
Copy link
Author

Hi @ahmetmircik,

Thanks for the reply. We already tried this workaround and it's not working. Is there any other way possible as of now?

@ahmetmircik
Copy link
Member

Hi, it will be fixed in 3.7. As an other alternative, if you can use jcache instead of imap, this problem should not be happen.

@d123456temp
Copy link

This is definitely NOT fixed for the LRU strategy. Newly added items are still being evicted straight away before really old entries when Map is working at almost-full size (so it reached max-elements-count).
This is the first bad experience I had with HAzelcast. It would be a shame as this is pretty much very important, basic functionality that should work without any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants