-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Hazelcast Client Near cache returns old value #8838
Comments
I checked the same scenario without the near cache configuration and it works as designed. (All good) |
Hi @ohadbehore, Is the issue specific for For the time being, no direct way to monitor near-cache read and writes. But you can listen updates on a key via Btw, is it possible to send a reproducer? |
Most Places I updated I use map#submitToKey but there is one place I update the map entries using map#executeOnEntries which includes SQL Predicate. Could this be the issue? Regarding the EntryUpdatedListener is looking only at remote cache updates? Or does it look at the near cache? |
No it should be fine.
This is an excerpt from your first statement above |
Regarding your comment:
From the following link (official Hazelcast documentation):
On the current node (Hazelcast client) the near cache is updated immediately according to Hazelcast, as long as all updates are sent from the current node (explicitly or via entry processor). |
That page belongs to JCache near-cache implementation, The |
@ohadbehore where are we on this? |
The issue, I described above, occurs with Hazelcast client that has NearCache. From My understanding Hazelcast client that has a near cache, the near cache is configured as JCache. In the documentation it says :
I'm sorry if that was not clear, but I believe I did say that I was using Hazelcast client with near cache. |
is it possible to create a reproducer? |
@ohadbehore You are misguided by that sentence in the documentation. We have a lot of different Near Cache scenarios and combinations of them:
If you are working with an Please find an explanation of the XML tags here: http://docs.hazelcast.org/docs/3.7/manual/html-single/index.html#creating-near-cache-for-map There is also an explanation for the Near Cache invalidation in the context of |
Hi ahmetmircik and Donnerbart, But I'm trying to understand the issue here. So if I use IMap with Near cache on Hazelcast client. How can I know that the near cache is updated? Again, I really appreciate the help. |
You can check if latest nearCached value in sync with value on remote imap with something like this: // Listen entry additions and updates on remote imap
// Check nearCachedValue against actualValue
|
Ok, I checked it. And sometimes the Near cache is not accurate. |
One more requirement, the data in the same Hazelcast client (Web-logic application) node sending the updates must be up to date. |
@ahmetmircik: I assume this is fixed now? |
Unfortunately this did not work.
בתאריך יום ב׳, 12 בדצמ׳ 2016, 14:52, מאת Jaromir Hamala <
notifications@github.com>:
… @ahmetmircik <https://github.com/ahmetmircik>: I assume this is fixed now?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8838 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKNfXYhuPpcmVIPinYB2s32v1YpIfNVPks5rHUN1gaJpZM4J0iKh>
.
|
@ohadbehore, you did test with latest 3.7 which is 3.7.4? |
No I did not. |
@ohadbehore It's hard to understand the real problem to me after reading this thread. It somehow feels like two problems to me:
|
Hi @ohadbehore, did you have a chance to retry with latest 3.7 or 3.8 releases? So far we couldn't reproduce the issue. |
Hi,
I think that multiple updates to cache are more fit to replicated map
structure.
Although we cannot get a guarantee for consistency as thee is in an Imap.
I thin the issue was one of trying to load values that less than one
millisecond ago have been updated.
This will probably work only on replicated map structure.
Thank you,
I think you can close the bug.
Ohad behore
…On Thu, Jul 6, 2017, 2:38 PM ahmetmircik ***@***.***> wrote:
Hi @ohadbehore <https://github.com/ohadbehore>, did you have a chance to
retry with latest 3.7 or 3.8 releases? So far we couldn't reproduce the
issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8838 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKNfXabAeeZAR1Jq9VJRV7VQX9dA0g7vks5sLMc8gaJpZM4J0iKh>
.
|
The Nevertheless you have to understand that the Near Cache will always have a short period, where it returns a stale value, when the source value has been changed on another node. We cannot beat physics! And this is the trade-off of having any kind of local cache (it's super fast to read, but a remote update takes its time). I'm also not sure if you fully understood the invalidation system and its tuning parameters. We overhauled the Near Cache documentation in Hazelcast 3.8. It's now a single chapter with all information in one place: http://docs.hazelcast.org/docs/3.8.3/manual/html-single/index.html#near-cache Please have a close look at that (and don't confuse JCache with Near Cache, you're using IMap, so nothing with JCache will apply, e.g. I'm closing this issue, feel free to open it, if you can provide a reproducer to your original issue. |
I'm using Hazelcast 3.7.
I have an issue that an IMap configured with near-cache on Hazelcast client instance returns the old value (previous value that was stored in cache) after setting a new value using IMap=>submitToKey method with an entry processor.
From the Hazelcast documentation and local testing I saw that local near-cache should update when submitting an entry processor from the current client.
Is there a way I can configure a log (on Hazelcast client side) that will show all access to near cache (reads/writes)?
I want to make sure that no data is written to a specific key that I'm looking at, between the last update and the time the next read operation occurred (the one that returns the stale data).
The issue only occours when there is a load of about 50 (about 10:1 read:write ratio) requests per second on the Hazelcast client (Which is a weblogic application server).
My Weblogic Application that uses Hazelcast client is a multi threaded code, so I'm not eliminating the option that another thread might have updated the old value to the IMap again. But I need to check if this is the case.
I appriciate your help.
Ohad Behore
The text was updated successfully, but these errors were encountered: