Hi,
As per my understanding if the node joins the cluster after loadCache
method on first node is executed then only partitions are moved to new node
as a part of rebalancing and loadCache method is not executed on this node.
But if the node joins before or during the execution of loadCache method on
the first node then loadCache method is executed on 2nd node too and it
fetches all the data and while pushing it to cache(closure.apply), it just
pushes the data which is relevant to this node and all other data is
discarded.
I am starting the second node after the cacheLoad is completed on first
node(I am starting both nodes on same machine in Intellij). When I start
the second node I see rebalancing started and completed in log file but
after the loadCache method is executed on it and it executes all the sqls
get all the data.
Can you please advise?
My configuration is as follows.
private IgniteConfiguration getIgniteConfiguration(){
String HOST = "127.0.0.1:47500..47509";
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Collections.singletonList(HOST));
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setDiscoverySpi(discoSpi);
cfg.setIgniteInstanceName("springDataNode");
cfg.setPeerClassLoadingEnabled(false);
cfg.setRebalanceThreadPoolSize(4);
CacheConfiguration<IPRangeDataKey, IPV4RangeData>
ipv4RangeCacheCfg = new CacheConfiguration<>("IPV4RangeCache");
ipv4RangeCacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
ipv4RangeCacheCfg.setWriteThrough(false);
ipv4RangeCacheCfg.setReadThrough(true);
ipv4RangeCacheCfg.setRebalanceMode(CacheRebalanceMode.ASYNC);
ipv4RangeCacheCfg.setBackups(1);
Factory<IPV4RangeCacheDataLoader> storeFactory =
FactoryBuilder.factoryOf(IPV4RangeCacheDataLoader.class);
ipv4RangeCacheCfg.setCacheStoreFactory(storeFactory);
cfg.setCacheConfiguration(ipv4RangeCacheCfg);
return cfg;
}