You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Kristian Rosenvold (JIRA)" <ji...@apache.org> on 2016/06/23 07:46:16 UTC

[jira] [Comment Edited] (IGNITE-3357) getOrCreateCache on second node fails replication if first node is doing loadCache

    [ https://issues.apache.org/jira/browse/IGNITE-3357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15345988#comment-15345988 ] 

Kristian Rosenvold edited comment on IGNITE-3357 at 6/23/16 7:45 AM:
---------------------------------------------------------------------

There is a fairly simple workaround, instead of using loadCache use a data streamer. As far as my testing has shown, this does not have the same problem.

{code}
//			cache.loadCache((k, v) -> true, Integer.MAX_VALUE);
final CacheStore<? super K, ? super V> cacheStore = cacheConfiguration.getCacheStoreFactory().create();
try (IgniteDataStreamer<Object, Object> streamer = ignite.dataStreamer(cacheConfiguration.getName())) {
   streamer.allowOverwrite(false);
   cacheStore.loadCache(streamer::addData, Integer.MAX_VALUE);
}
{code}



was (Author: krosenvold):
There is a fairly simple workaround, instead of using loadCache use a data streamer. As far as my testing has shown, this does not have the same problem.

{code}
//			cache.loadCache((k, v) -> true, Integer.MAX_VALUE);
			final CacheStore<? super K, ? super V> cacheStore = cacheConfiguration.getCacheStoreFactory().create();
			try (IgniteDataStreamer<Object, Object> streamer = ignite.dataStreamer(cacheConfiguration.getName())) {
				streamer.allowOverwrite(false);
				cacheStore.loadCache(streamer::addData, Integer.MAX_VALUE);
			}
{code}


> getOrCreateCache on second node fails replication if first node is doing loadCache
> ----------------------------------------------------------------------------------
>
>                 Key: IGNITE-3357
>                 URL: https://issues.apache.org/jira/browse/IGNITE-3357
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 1.6, 1.7
>            Reporter: Kristian Rosenvold
>
> If the first node on a REPLICATED cache is doing loadCache, a subsequent node that starts while this operation is in process will not reach identical state as the first node.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)