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.



2016-06-18 15:14 GMT+03:00 Kristian Rosenvold <[email protected]>:

> 2016-06-18 13:02 GMT+02:00 Alexei Scherbakov <[email protected]
> >:
> > You should be safe calling loadCache just after getOrCreate.
>
> I am testing various disaster recovery scenarios here, and I'm not
> entirely convinced this is the case.
> Our system starts 6 replicated caches, the script below outputs the
> size from each node:
>
> $ cacheStatus
> 1663837 1528370 1038204 1663837 1528370 1663759
> 1663837 1528370 1038204 95089 1528370 1663759
>
> $ cacheStatus
> 1663882 1528410 1038204 1663882 1528410 1663804
> 1663882 1528410 1038204 1663882 1101911 1663804
>
> $ cacheStatus
> 1663893 1528420 1038208 1663893 1528420 1663815
> 1634199 1528420 1038208 1663893 1528420 1663815
>
> Both nodes run the same code, getOrCreate followed by a conditional
> load. In all of the above 3 cases, the cache that is being loaded on
> the first node at the moment the second node starts does not
> synchronize properly; I can in fact control which cache gets corrupted
> by delaying the start of node 2 by X seconds. The second node does not
> enter the "load" block, presumably because it has received data from
> the first during getOrCreate.
>
> I'm using ignite-core-1.7.0-20160616.230251-11.jar.
>
> We're not using any kind of staggered startup, which might be a
> sort-of workaround.
>
> Kristian
>



-- 

Best regards,
Alexei Scherbakov

Reply via email to