I have created a testcase that quite consistently reproduces this problem on my mac; https://gist.github.com/krosenvold/fa20521ad121a0cbb4c6ed6be91452e5
If you start two processes with this main method, and stagger startup of the second process by about 10 seconds, the second process will almost never achieve any kind of consistent cache. This just does not make any sense with a cache that is replicated ?!? Kristian 2016-06-21 9:28 GMT+02:00 Kristian Rosenvold <krosenv...@apache.org>: > 2016-06-20 10:27 GMT+02:00 Alexei Scherbakov <alexey.scherbak...@gmail.com>: >> Hi, >> >> You should not rely on cache.size method for checking data consistency. >> cache.size skips keys which is not currently loaded by read-through >> behavior. > > Sorry for not mentioning that this is CacheMode.REPLICATED and > CacheRebalanceMode.SYNC. I really do expect the sizes to be fairly > consistent, or is there some other mechanism I should be using to get > a consistent view of the cache ? > > Kristian