Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Query on IMap with indexes returns stale data #359
Doing a predicate query on an IMap that has indexes sometimes returns stale data, while retrieving a value with IMap.get(key) always returns the most current value. Once a node begins returning stale data, it will always return that same stale value for all future queries. The problem seems to be triggered by another node joining the cluster while a query is in progress.
We have seen this issue in Hazelcast 2.1.3 and 2.4.
I will attach code to demonstrate the issue in a comment to this issue.
I've uploaded a program (and associated hazelcast.xml file) to demonstrate the issue at https://gist.github.com/4118374
To see the problem, run multiple (up to 6) instances of the Demo.java program. All instances may be run on the same machine in separate JVMs. When a query begins returning values that do not match the values returned by IMap.get(key), the program will display an error message.
I usually get the error by the time I launch the 4th instance, but sometimes I can get all 6 instances running without error. In that case, I kill (ctrl-c) and restart one instance until the error occurs.