RE: Re[6]: Mixing persistent and in memory cache
Hi Zhenya, thanks, „baseline“ was the right way to go. I missed the text in the documentation saying that the baseline is only automatically adjusted for *pure* in memory clusters. However, I understood that the baseline defines the nodes where information is stored – and does not restrict the nodes from where it can be accessed. I would have expected that a cluster access on a node not holding the information gets forwarded to a node that has it. This seems not always to be the case(?) Hint: I had to set the baseline topology explicitly to get it working: Collection nodes = ignite.cluster().forServers().nodes(); ignite.cluster().setBaselineTopology(nodes); or: ignite.cluster().baselineAutoAdjustEnabled(true); ignite.cluster().baselineAutoAdjustTimeout(3); --- Mit freundlichen Grüßen Stephan Hesse Geschäftsführer DICOS GmbH Kommunikationssysteme Alsfelder Straße 11, 64289 Darmstadt Telefon: +49 6151 82787 27, Mobil: +49 1761 82787 27 www.dicos.de<http://www.dicos.de/> DICOS GmbH Kommunikationssysteme, Darmstadt, Amtsgericht Darmstadt HRB 7024, Geschäftsführer: Dr. Winfried Geyer, Stephan Hesse, Waldemar Wiesner From: Zhenya Stanilovsky Sent: Tuesday, March 2, 2021 7:03 AM To: user@ignite.apache.org Subject: Re[6]: Mixing persistent and in memory cache Ok i found ! 18:36:07 noringBase.infoINFO Topology snapshot [ver=2, locNode=2bf85583, servers=2, clients=0, state=ACTIVE, CPUs=8, offheap=6.3GB, heap=3.5GB] 18:36:07 noringBase.infoINFO ^-- Baseline [id=0, size=1, online=1, offline=0] you call baseline command after first node was started, thus you have 2 alive nodes with only one in baseline. clear your persistent directories, and rewrite code like : startNode(...a..) ignite = startNode(..b...) ignite.cluster().state(ClusterState.ACTIVE); Hi Zhenya, To be on the safe side, I increased the sleep to 5 sec. I also removed the setBackups(2) – no difference – the test is still failing! Newest log file with corresponding source attached. I added more specific logs: 18:36:07 lusterTest.testMem2INFO >>>>>> value has been written to 'a': aval 18:36:12 lusterTest.testMem2INFO >>>>>> value retrieved from 'b': null --- Mit freundlichen Grüßen Stephan Hesse Geschäftsführer DICOS GmbH Kommunikationssysteme Alsfelder Straße 11, 64289 Darmstadt Telefon: +49 6151 82787 27, Mobil: +49 1761 82787 27 www.dicos.de<https://eur04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.dicos.de%2F&data=04%7C01%7Cs.hesse%40dicos.de%7Cd83cdcaac247472db9f208d8dd40de9a%7Cac9cfe7f98014e47b9fef4a671e0ab36%7C1%7C0%7C637502618570355193%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=FL%2B%2F6kJfF40FnajOpX6uWQY4WuvOVuO5ImLT5FPGAcc%3D&reserved=0> DICOS GmbH Kommunikationssysteme, Darmstadt, Amtsgericht Darmstadt HRB 7024, Geschäftsführer: Dr. Winfried Geyer, Stephan Hesse, Waldemar Wiesner From: Zhenya Stanilovsky > Sent: Monday, March 1, 2021 7:15 AM To: user@ignite.apache.org Subject: Re[4]: Mixing persistent and in memory cache hi Stephan, due to logs rebalance still in progress (probably slow network ?) will test pass if you increase sleep interval ? 2 sec fro example ? Additionally no need to set .setBackups(2) in CacheMode.REPLICATED cache, plz check documentation. Hi Zhenya, your 2nd point: yes, the cache itself has been propagated. Please be aware that I have successfully used the same test with only the in-memory region as well as with only the persistent region. Only when I combine both, the synchronization stops working for the in memory region. Please find attached the log file (both Ignite nodes run in the same process and contribute to this log file) as well as the current Junit test. In the log file you will find: The node startup: >>>> starting node A >>>> starting node B The test case startup: testMem2 The test stops with: java.lang.AssertionError: expected: but was: … at de.dicos.cpcfe.ignite.IgniteClusterTest.testMem2(IgniteClusterTest.java:175) --- Mit freundlichen Grüßen Stephan Hesse Geschäftsführer DICOS GmbH Kommunikationssysteme Alsfelder Straße 11, 64289 Darmstadt Telefon: +49 6151 82787 27, Mobil: +49 1761 82787 27 www.dicos.de<https://eur04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.dicos.de%2F&data=04%7C01%7Cs.hesse%40dicos.de%7Cd83cdcaac247472db9f208d8dd40de9a%7Cac9cfe7f98014e47b9fef4a671e0ab36%7C1%7C0%7C637502618570355193%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=FL%2B%2F6kJfF40FnajOpX6uWQY4WuvOVuO5ImLT5FPGAcc%3D&reserved=0> DICOS GmbH Kommunikationssysteme, Darmstadt, Amtsgericht Darmstadt HRB 7024, Geschäftsführer: Dr. Winfried Geyer, Stepha
Re[6]: Mixing persistent and in memory cache
Ok i found ! 18:36:07 noringBase.info INFO Topology snapshot [ver=2, locNode=2bf85583, servers=2, clients=0, state=ACTIVE, CPUs=8, offheap=6.3GB, heap=3.5GB] 18:36:07 noringBase.info INFO ^-- Baseline [id=0, size=1, online=1, offline=0] you call baseline command after first node was started, thus you have 2 alive nodes with only one in baseline. clear your persistent directories, and rewrite code like : startNode(...a..) ignite = startNode(..b...) ignite.cluster().state(ClusterState.ACTIVE); > >> >>>Hi Zhenya, >>>To be on the safe side, I increased the sleep to 5 sec. I also removed the >>>setBackups(2) – no difference – the test is still failing! >>> >>>Newest log file with corresponding source attached. >>> >>>I added more specific logs: >>> >>>18:36:07 lusterTest.testMem2 INFO >>>>>> value has been written to >>>'a': aval >>>18:36:12 lusterTest.testMem2 INFO >>>>>> value retrieved from 'b': >>>null >>> >>>--- >>>Mit freundlichen Grüßen >>> >>>Stephan Hesse >>>Geschäftsführer >>> >>>DICOS GmbH Kommunikationssysteme >>>Alsfelder Straße 11, 64289 Darmstadt >>> >>>Telefon: +49 6151 82787 27 , Mobil: +49 1761 82787 27 >>> >>>www.dicos.de >>> >>>DICOS GmbH Kommunikationssysteme, Darmstadt, Amtsgericht Darmstadt HRB 7024, >>>Geschäftsführer: Dr. Winfried Geyer, Stephan Hesse, Waldemar Wiesner >>> >>> >>> >>>From: Zhenya Stanilovsky < arzamas...@mail.ru > >>>Sent: Monday, March 1, 2021 7:15 AM >>>To: user@ignite.apache.org >>>Subject: Re[4]: Mixing persistent and in memory cache >>> >>> >>>hi Stephan, due to logs rebalance still in progress (probably slow >>>network ?) will test pass if you increase sleep interval ? 2 sec fro example >>>? >>>Additionally no need to set .setBackups(2) in CacheMode.REPLICATED cache, >>>plz check documentation. >>> >>> >>>>Hi Zhenya, >>>> >>>>your 2nd point: yes, the cache itself has been propagated. >>>> >>>>Please be aware that I have successfully used the same test with only the >>>>in-memory region as well as with only the persistent region. Only when I >>>>combine both, the synchronization stops working for the in memory region. >>>> >>>> >>>>Please find attached the log file (both Ignite nodes run in the same >>>>process and contribute to this log file) as well as the current Junit test. >>>> >>>>In the log file you will find: >>>> >>>>The node startup: >>>>>>>> starting node A >>>>>>>> starting node B >>>> >>>>The test case startup: >>>> testMem2 >>>> >>>>The test stops with: >>>>java.lang.AssertionError: expected: but was: >>>> … >>>> at >>>>de.dicos.cpcfe.ignite.IgniteClusterTest.testMem2(IgniteClusterTest.java:175) >>>> >>>>--- >>>>Mit freundlichen Grüßen >>>> >>>>Stephan Hesse >>>>Geschäftsführer >>>> >>>>DICOS GmbH Kommunikationssysteme >>>>Alsfelder Straße 11, 64289 Darmstadt >>>> >>>>Telefon: +49 6151 82787 27 , Mobil: +49 1761 82787 27 >>>> >>>>www.dicos.de >>>> >>>>DICOS GmbH Kommunikationssysteme, Darmstadt, Amtsgericht Darmstadt HRB 7024, >>>>Geschäftsführer: Dr. Winfried Geyer, Stephan Hesse, Waldemar Wiesner >>>> >>>> >>>> >>>>From: Zhenya Stanilovsky < arzamas...@mail.ru > >>>>Sent: Friday, February 26, 2021 6:57 AM >>>>To: user@ignite.apache.org >>>>Subject: Re[2]: Mixing persistent and in memory cache >>>> >>>> >>>>hi Stephan, something wrong with configuration probably … it`s not expected >>>>issue. >>>>* plz attach somehow or send me ignite.log from all server nodes ? >>>>* If you change second call : >>>>IgniteCache kva = getInMemoryKeyValue(igA); >>>> >>>> IgniteCache kvb = getInMemoryKeyValue(igB); ← here >>>>for something like : IgniteCache kvb = >>>>getInMemoryKeyValue2(igB); >>>> >>>>private IgniteCache getInMemoryKeyValue2(Ignite ignite) >>>> { >>>> return ignite.cache(new CacheConfiguration() <--- >>>> >>>>just to check that cache has been already created. >>>> >>>>Does ignite.cache will see the previously created cache ? >>>> >>>>thanks ! >>>> >>>> >>>>>Hi Zhenya, thanks for this suggestion. >>>>> >>>>>However, neither setting CacheWriteSynchronizationMode to Full Sync nor >>>>>setting it to FULL_ASYNC changes anything: memory cahce changes do not get >>>>>propagated: >>>>> >>>>>private IgniteCache getInMemoryKeyValue(Ignite ignite) >>>>>{ >>>>>return ignite.getOrCreateCache(new CacheConfiguration() >>>>>.setName("memkv") >>>>>.setCacheMode(CacheMode.REPLICATED) >>>>>.setDataRegionName(NodeController.IN_MEMORY_REGION) >>>>>.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) >>>>>.setBackups(2)); >>>>>} >>>>> >>>>> >>>>> >>>>> >>>>>-- >>>>>Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >>>> >>>> >>>> >>>> >>> >>> >>> >>> >> >> >> >>
Re[4]: Mixing persistent and in memory cache
hi Stephan, due to logs rebalance still in progress (probably slow network ?) will test pass if you increase sleep interval ? 2 sec fro example ? Additionally no need to set .setBackups(2) in CacheMode.REPLICATED cache, plz check documentation. >Hi Zhenya, > >your 2nd point: yes, the cache itself has been propagated. > >Please be aware that I have successfully used the same test with only the >in-memory region as well as with only the persistent region. Only when I >combine both, the synchronization stops working for the in memory region. > > >Please find attached the log file (both Ignite nodes run in the same process >and contribute to this log file) as well as the current Junit test. > >In the log file you will find: > >The node startup: >>>>> starting node A >>>>> starting node B > >The test case startup: > testMem2 > >The test stops with: >java.lang.AssertionError: expected: but was: > … > at >de.dicos.cpcfe.ignite.IgniteClusterTest.testMem2(IgniteClusterTest.java:175) > >--- >Mit freundlichen Grüßen > >Stephan Hesse >Geschäftsführer > >DICOS GmbH Kommunikationssysteme >Alsfelder Straße 11, 64289 Darmstadt > >Telefon: +49 6151 82787 27 , Mobil: +49 1761 82787 27 > >www.dicos.de > >DICOS GmbH Kommunikationssysteme, Darmstadt, Amtsgericht Darmstadt HRB 7024, >Geschäftsführer: Dr. Winfried Geyer, Stephan Hesse, Waldemar Wiesner > > > >From: Zhenya Stanilovsky < arzamas...@mail.ru > >Sent: Friday, February 26, 2021 6:57 AM >To: user@ignite.apache.org >Subject: Re[2]: Mixing persistent and in memory cache > > >hi Stephan, something wrong with configuration probably … it`s not expected >issue. >* plz attach somehow or send me ignite.log from all server nodes ? >* If you change second call : >IgniteCache kva = getInMemoryKeyValue(igA); > > IgniteCache kvb = getInMemoryKeyValue(igB); ← here >for something like : IgniteCache kvb = >getInMemoryKeyValue2(igB); > >private IgniteCache getInMemoryKeyValue2(Ignite ignite) > { > return ignite.cache(new CacheConfiguration() <--- > >just to check that cache has been already created. > >Does ignite.cache will see the previously created cache ? > >thanks ! > > >>Hi Zhenya, thanks for this suggestion. >> >>However, neither setting CacheWriteSynchronizationMode to Full Sync nor >>setting it to FULL_ASYNC changes anything: memory cahce changes do not get >>propagated: >> >>private IgniteCache getInMemoryKeyValue(Ignite ignite) >>{ >>return ignite.getOrCreateCache(new CacheConfiguration() >>.setName("memkv") >>.setCacheMode(CacheMode.REPLICATED) >>.setDataRegionName(NodeController.IN_MEMORY_REGION) >>.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) >>.setBackups(2)); >>} >> >> >> >> >>-- >>Sent from: http://apache-ignite-users.70518.x6.nabble.com/ > > > >
RE: Re[2]: Mixing persistent and in memory cache
Hi Zhenya, your 2nd point: yes, the cache itself has been propagated. Please be aware that I have successfully used the same test with only the in-memory region as well as with only the persistent region. Only when I combine both, the synchronization stops working for the in memory region. Please find attached the log file (both Ignite nodes run in the same process and contribute to this log file) as well as the current Junit test. In the log file you will find: The node startup: >>>> starting node A >>>> starting node B The test case startup: testMem2 The test stops with: java.lang.AssertionError: expected: but was: … at de.dicos.cpcfe.ignite.IgniteClusterTest.testMem2(IgniteClusterTest.java:175) --- Mit freundlichen Grüßen Stephan Hesse Geschäftsführer DICOS GmbH Kommunikationssysteme Alsfelder Straße 11, 64289 Darmstadt Telefon: +49 6151 82787 27, Mobil: +49 1761 82787 27 www.dicos.de<http://www.dicos.de/> DICOS GmbH Kommunikationssysteme, Darmstadt, Amtsgericht Darmstadt HRB 7024, Geschäftsführer: Dr. Winfried Geyer, Stephan Hesse, Waldemar Wiesner From: Zhenya Stanilovsky Sent: Friday, February 26, 2021 6:57 AM To: user@ignite.apache.org Subject: Re[2]: Mixing persistent and in memory cache hi Stephan, something wrong with configuration probably … it`s not expected issue. 1. plz attach somehow or send me ignite.log from all server nodes ? 2. If you change second call : IgniteCache kva = getInMemoryKeyValue(igA); IgniteCache kvb = getInMemoryKeyValue(igB); ← here for something like : IgniteCache kvb = getInMemoryKeyValue2(igB); private IgniteCache getInMemoryKeyValue2(Ignite ignite) { return ignite.cache(new CacheConfiguration() <--- just to check that cache has been already created. Does ignite.cache will see the previously created cache ? thanks ! Hi Zhenya, thanks for this suggestion. However, neither setting CacheWriteSynchronizationMode to Full Sync nor setting it to FULL_ASYNC changes anything: memory cahce changes do not get propagated: private IgniteCache getInMemoryKeyValue(Ignite ignite) { return ignite.getOrCreateCache(new CacheConfiguration() .setName("memkv") .setCacheMode(CacheMode.REPLICATED) .setDataRegionName(NodeController.IN_MEMORY_REGION) .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) .setBackups(2)); } -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/<https://eur04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-ignite-users.70518.x6.nabble.com%2F&data=04%7C01%7Cs.hesse%40dicos.de%7Cd789d1f0f4db40a1259208d8da1b5c6b%7Cac9cfe7f98014e47b9fef4a671e0ab36%7C1%7C0%7C637499158770576790%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=5TvORxPKiEU7dSuYaqyyiOI%2Fvg%2FZuXWO0Bncr6ONBnA%3D&reserved=0> testMem2.log Description: testMem2.log IgniteClusterTest.java Description: IgniteClusterTest.java
Re[2]: Mixing persistent and in memory cache
hi Stephan, something wrong with configuration probably … it`s not expected issue. * plz attach somehow or send me ignite.log from all server nodes ? * If you change second call : IgniteCache kva = getInMemoryKeyValue(igA); IgniteCache kvb = getInMemoryKeyValue(igB); ← here for something like : IgniteCache kvb = getInMemoryKeyValue2(igB); private IgniteCache getInMemoryKeyValue2(Ignite ignite) { return ignite.cache(new CacheConfiguration() <--- just to check that cache has been already created. Does ignite.cache will see the previously created cache ? thanks ! >Hi Zhenya, thanks for this suggestion. > >However, neither setting CacheWriteSynchronizationMode to Full Sync nor >setting it to FULL_ASYNC changes anything: memory cahce changes do not get >propagated: > >private IgniteCache getInMemoryKeyValue(Ignite ignite) >{ >return ignite.getOrCreateCache(new CacheConfiguration() >.setName("memkv") >.setCacheMode(CacheMode.REPLICATED) >.setDataRegionName(NodeController.IN_MEMORY_REGION) >.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) >.setBackups(2)); >} > > > > >-- >Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Mixing persistent and in memory cache
Hi Zhenya, thanks for this suggestion. However, neither setting CacheWriteSynchronizationMode to Full Sync nor setting it to FULL_ASYNC changes anything: memory cahce changes do not get propagated: private IgniteCache getInMemoryKeyValue(Ignite ignite) { return ignite.getOrCreateCache(new CacheConfiguration() .setName("memkv") .setCacheMode(CacheMode.REPLICATED) .setDataRegionName(NodeController.IN_MEMORY_REGION) .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) .setBackups(2)); } -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Mixing persistent and in memory cache
Sorry for previous, full_sync of course [1] [1] https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/cache/CacheWriteSynchronizationMode.html#FULL_SYNC >Hi, > >I am trying to set up a system with some chaes in a persistent and some in an >in-memory region. > >However, it seems that the in-memory regions don’t get synchronized between >the nodes. This would work with a pure setup of either only an in-memory >region or only a persistent one. > >Below is a complete JUnit test showing my issue. The “testMem“ will fail >because the update made on node “a” does not reach node “b”. Any suggestions? > >Ignite version: 2.9.1 > > >package de.dicos.cpcfe.ignite; > >import java.io.File; >import java.util.Arrays; >import java.util.List; > >import org.apache.ignite.Ignite; >import org.apache.ignite.IgniteCache; >import org.apache.ignite.Ignition; >import org.apache.ignite.cache.CacheMode; >import org.apache.ignite.cluster.ClusterState; >import org.apache.ignite.configuration.CacheConfiguration; >import org.apache.ignite.configuration.ClientConnectorConfiguration; >import org.apache.ignite.configuration.ConnectorConfiguration; >import org.apache.ignite.configuration.DataRegionConfiguration; >import org.apache.ignite.configuration.DataStorageConfiguration; >import org.apache.ignite.configuration.IgniteConfiguration; >import org.apache.ignite.internal.IgniteEx; >import org.apache.ignite.logger.slf4j.Slf4jLogger; >import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; >import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; >import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; >import org.junit.After; >import org.junit.Assert; >import org.junit.Before; >import org.junit.Test; >import org.slf4j.Logger; >import org.slf4j.LoggerFactory; > >/** >* >* @author sth >*/ >public class IgniteClusterTest >{ > // / > // Class Fields > // / > /** */ > private static Logger log = >LoggerFactory.getLogger(IgniteClusterTest.class); > > /** */ > private IgniteEx igA; > > /** */ > private IgniteEx igB; > > /** */ > public static final String PERSISTENT_REGION = "persistent"; > > /** */ > public static final String IN_MEMORY_REGION = "inmemory"; > > // / > // Constructors > // / > /** > */ > public IgniteClusterTest() > { > } > > // / > // Methods > // / > /** > * @throws java.lang.Exception > */ > @Before > public void setUp() > throws Exception > { > try { > log.info(" starting node >A"); > File da = new >File("target/idd-a"); > rmrf(da); > igA = startNode("a", da, 47500, >47100, 11211, 10800); > log.info(" node A is >running"); > > Thread.sleep(1000); > > log.info(" starting node >B"); > File db = new >File("target/idd-b"); > rmrf(db); > igB = startNode("b", db, 47501, >47101, 11212, 10801); > log.info(" node B is >running"); > > } catch (Throwable x) { > log.error("unexpected >exception", x); > throw x; > } > } > > /** > * @throws java.lang.Exception > */ > @After > public void tearDown() > throws Exception > { > log.info(" stopping all nodes"); > Ignition.stopAll(true); > } > > > @Test > public void testPerm() throws InterruptedException >
Re: Mixing persistent and in memory cache
hi, seems you need to append additional sync option [1] [1] https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/cache/CacheWriteSynchronizationMode.html#FULL_ASYNC >Hi, > >I am trying to set up a system with some chaes in a persistent and some in an >in-memory region. > >However, it seems that the in-memory regions don’t get synchronized between >the nodes. This would work with a pure setup of either only an in-memory >region or only a persistent one. > >Below is a complete JUnit test showing my issue. The “testMem“ will fail >because the update made on node “a” does not reach node “b”. Any suggestions? > >Ignite version: 2.9.1 > > >package de.dicos.cpcfe.ignite; > >import java.io.File; >import java.util.Arrays; >import java.util.List; > >import org.apache.ignite.Ignite; >import org.apache.ignite.IgniteCache; >import org.apache.ignite.Ignition; >import org.apache.ignite.cache.CacheMode; >import org.apache.ignite.cluster.ClusterState; >import org.apache.ignite.configuration.CacheConfiguration; >import org.apache.ignite.configuration.ClientConnectorConfiguration; >import org.apache.ignite.configuration.ConnectorConfiguration; >import org.apache.ignite.configuration.DataRegionConfiguration; >import org.apache.ignite.configuration.DataStorageConfiguration; >import org.apache.ignite.configuration.IgniteConfiguration; >import org.apache.ignite.internal.IgniteEx; >import org.apache.ignite.logger.slf4j.Slf4jLogger; >import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; >import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; >import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; >import org.junit.After; >import org.junit.Assert; >import org.junit.Before; >import org.junit.Test; >import org.slf4j.Logger; >import org.slf4j.LoggerFactory; > >/** >* >* @author sth >*/ >public class IgniteClusterTest >{ > // / > // Class Fields > // / > /** */ > private static Logger log = >LoggerFactory.getLogger(IgniteClusterTest.class); > > /** */ > private IgniteEx igA; > > /** */ > private IgniteEx igB; > > /** */ > public static final String PERSISTENT_REGION = "persistent"; > > /** */ > public static final String IN_MEMORY_REGION = "inmemory"; > > // / > // Constructors > // / > /** > */ > public IgniteClusterTest() > { > } > > // / > // Methods > // / > /** > * @throws java.lang.Exception > */ > @Before > public void setUp() > throws Exception > { > try { > log.info(" starting node >A"); > File da = new >File("target/idd-a"); > rmrf(da); > igA = startNode("a", da, 47500, >47100, 11211, 10800); > log.info(" node A is >running"); > > Thread.sleep(1000); > > log.info(" starting node >B"); > File db = new >File("target/idd-b"); > rmrf(db); > igB = startNode("b", db, 47501, >47101, 11212, 10801); > log.info(" node B is >running"); > > } catch (Throwable x) { > log.error("unexpected >exception", x); > throw x; > } > } > > /** > * @throws java.lang.Exception > */ > @After > public void tearDown() > throws Exception > { > log.info(" stopping all nodes"); > Ignition.stopAll(true); > } > > > @Test > public void testPerm() throws InterruptedExce
Mixing persistent and in memory cache
Hi, I am trying to set up a system with some chaes in a persistent and some in an in-memory region. However, it seems that the in-memory regions don't get synchronized between the nodes. This would work with a pure setup of either only an in-memory region or only a persistent one. Below is a complete JUnit test showing my issue. The "testMem" will fail because the update made on node "a" does not reach node "b". Any suggestions? Ignite version: 2.9.1 package de.dicos.cpcfe.ignite; import java.io.File; import java.util.Arrays; import java.util.List; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.Ignition; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.ClientConnectorConfiguration; import org.apache.ignite.configuration.ConnectorConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.logger.slf4j.Slf4jLogger; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * * @author sth */ public class IgniteClusterTest { // / // Class Fields // / /** */ private static Logger log = LoggerFactory.getLogger(IgniteClusterTest.class); /** */ private IgniteEx igA; /** */ private IgniteEx igB; /** */ public static final String PERSISTENT_REGION = "persistent"; /** */ public static final String IN_MEMORY_REGION = "inmemory"; // / // Constructors // / /** */ public IgniteClusterTest() { } // / // Methods // / /** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { try { log.info(" starting node A"); File da = new File("target/idd-a"); rmrf(da); igA = startNode("a", da, 47500, 47100, 11211, 10800); log.info(" node A is running"); Thread.sleep(1000); log.info(" starting node B"); File db = new File("target/idd-b"); rmrf(db); igB = startNode("b", db, 47501, 47101, 11212, 10801); log.info(" node B is running"); } catch (Throwable x) { log.error("unexpected exception", x); throw x; } } /** * @throws java.lang.Exception */ @After public void tearDown() throws Exception { log.info(" stopping all nodes"); Ignition.stopAll(true); } @Test public void testPerm() throws InterruptedException { log.info(" "+new Exception().getStackTrace()[0].getMethodName()); IgniteCache kva = getKeyValue(igA); IgniteCache kvb = getKeyValue(igB); kva.put("a", "aval"); Assert.assertEquals("aval", kvb.get("a")); }