Mixing persistent and in memory cache

classic Classic list List threaded Threaded
10 messages Options
s.hesse@dicos.de s.hesse@dicos.de
Reply | Threaded
Open this post in threaded view
|

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<String, String> kva = getKeyValue(igA);

                               IgniteCache<String, String> kvb = getKeyValue(igB);

                              

                               kva.put("a", "aval");

                               Assert.assertEquals("aval", kvb.get("a"));

                }

 

                @Test

                public void testMem() throws InterruptedException

                {

                               log.info("#### "+new Exception().getStackTrace()[0].getMethodName());

                              

                               IgniteCache<String, String> kva = getInMemoryKeyValue(igA);

                               @SuppressWarnings("unused")

                               IgniteCache<String, String> kvb = getInMemoryKeyValue(igB);

                              

                               kva.put("a", "aval");

                              

                               Thread.sleep(1000);

                              

                               Assert.assertEquals("aval", kvb.get("a"));

                }

 

                /**

                *

                 */

                private IgniteEx startNode(String id, File datadir, int port, int commPort, int connectorPort, int clientPort)

                {

                               datadir.mkdirs();

                               String igniteDataDir = datadir.getAbsolutePath();

                              

                               DataRegionConfiguration persistentRegion = new DataRegionConfiguration()//

                                                                                              .setName(PERSISTENT_REGION)//

                                                                                              .setPersistenceEnabled(true);

                               DataRegionConfiguration inMemoryRegion = new DataRegionConfiguration()//

                                                                                              .setName(IN_MEMORY_REGION)//

                                                                                              .setPersistenceEnabled(false)//

                                                                                              ;

                              

                               List<String> clusterAddresses = Arrays.asList("127.0.0.1:47500..47501", "127.0.0.1:47505..47506");

                              

                               IgniteConfiguration igniteCfg = new IgniteConfiguration()//

                                               .setIgniteInstanceName(id)//

                                               .setWorkDirectory(igniteDataDir)//

                                               .setConsistentId("testcluster-"+id)//

                                               .setGridLogger(new Slf4jLogger())//

                                               .setMetricsLogFrequency(0)//

                                               .setDataStorageConfiguration(new DataStorageConfiguration()//

                                                               .setDefaultDataRegionConfiguration(persistentRegion)//

                                                               .setDataRegionConfigurations(inMemoryRegion))//

                                                               //.setDefaultDataRegionConfiguration(inMemoryRegion)//

                                                               //.setDataRegionConfigurations(persistentRegion))//

                                               .setDiscoverySpi(new TcpDiscoverySpi()//

                                                               .setIpFinder(new TcpDiscoveryVmIpFinder()//

                                                                               .setAddresses(clusterAddresses)

                                                                               .setShared(true))//

                                                               .setLocalAddress("127.0.0.1")//

                                                               .setLocalPort(port)//

                                                               .setLocalPortRange(2))

                                               .setCommunicationSpi(new TcpCommunicationSpi()//

                                                               .setMessageQueueLimit(1024)

                                                               .setLocalAddress("127.0.0.1")

                                                               .setLocalPort(commPort)

                                                               .setLocalPortRange(2))//

                                               .setConnectorConfiguration(new ConnectorConfiguration()

                                                               .setHost("127.0.0.1")

                                                               .setPort(connectorPort)

                                                               .setPortRange(2))

                                               .setClientConnectorConfiguration(new ClientConnectorConfiguration()

                                                               .setPort(clientPort)

                                                               .setPortRange(2));

 

                               IgniteEx ignite = (IgniteEx)Ignition.start(igniteCfg);

                              

                               ignite.cluster().state(ClusterState.ACTIVE);

 

                               return ignite;

                }

               

                /**

                *

                 */

                private IgniteCache<String, String> getKeyValue(Ignite ignite)

                {

                               return ignite.getOrCreateCache(new CacheConfiguration<String, String>()

                                                               .setName("permkv")

                                                               .setDataRegionName(PERSISTENT_REGION)

                                                               .setCacheMode(CacheMode.REPLICATED)

                                                               .setBackups(2));

                }

 

                /**

                *

                 */

                private IgniteCache<String, String> getInMemoryKeyValue(Ignite ignite)

                {

                               return ignite.getOrCreateCache(new CacheConfiguration<String, String>()

                                                               .setName("memkv")

                                                               .setCacheMode(CacheMode.REPLICATED)

                                                               .setDataRegionName(IN_MEMORY_REGION)

                                                               .setBackups(2));

                }

 

                /**

                * @param file

                */

                public static void rmrf(File file)

                {

                               if (file.isDirectory()) {

                                               for (File sub: file.listFiles()) {

                                                               String n = sub.getName();

                                                               if (".".equals(n) || "..".equals(n)) {

                                                                               continue;

                                                               }

                                                              

                                                               rmrf(sub);

                                               }

                               }

                              

                               log.debug("deleting "+file.getAbsolutePath());

                               file.delete();

                }

}

 

---

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

 

 

 

Zhenya Stanilovsky Zhenya Stanilovsky
Reply | Threaded
Open this post in threaded view
|

Re: Mixing persistent and in memory cache


hi, seems you need to append additional sync option [1]
 
 

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<String, String> kva = getKeyValue(igA);

                               IgniteCache<String, String> kvb = getKeyValue(igB);

                              

                               kva.put("a", "aval");

                               Assert.assertEquals("aval", kvb.get("a"));

                }

 

                @Test

                public void testMem() throws InterruptedException

                {

                               log.info("#### "+new Exception().getStackTrace()[0].getMethodName());

                              

                               IgniteCache<String, String> kva = getInMemoryKeyValue(igA);

                               @SuppressWarnings("unused")

                               IgniteCache<String, String> kvb = getInMemoryKeyValue(igB);

                              

                               kva.put("a", "aval");

                              

                               Thread.sleep(1000);

                              

                               Assert.assertEquals("aval", kvb.get("a"));

                }

 

                /**

                *

                 */

                private IgniteEx startNode(String id, File datadir, int port, int commPort, int connectorPort, int clientPort)

                {

                               datadir.mkdirs();

                               String igniteDataDir = datadir.getAbsolutePath();

                              

                               DataRegionConfiguration persistentRegion = new DataRegionConfiguration()//

                                                                                              .setName(PERSISTENT_REGION)//

                                                                                              .setPersistenceEnabled(true);

                               DataRegionConfiguration inMemoryRegion = new DataRegionConfiguration()//

                                                                                              .setName(IN_MEMORY_REGION)//

                                                                                              .setPersistenceEnabled(false)//

                                                                                              ;

                              

                               List<String> clusterAddresses = Arrays.asList("127.0.0.1:47500..47501", "127.0.0.1:47505..47506");

                              

                               IgniteConfiguration igniteCfg = new IgniteConfiguration()//

                                               .setIgniteInstanceName(id)//

                                               .setWorkDirectory(igniteDataDir)//

                                               .setConsistentId("testcluster-"+id)//

                                               .setGridLogger(new Slf4jLogger())//

                                               .setMetricsLogFrequency(0)//

                                               .setDataStorageConfiguration(new DataStorageConfiguration()//

                                                               .setDefaultDataRegionConfiguration(persistentRegion)//

                                                               .setDataRegionConfigurations(inMemoryRegion))//

                                                               //.setDefaultDataRegionConfiguration(inMemoryRegion)//

                                                               //.setDataRegionConfigurations(persistentRegion))//

                                               .setDiscoverySpi(new TcpDiscoverySpi()//

                                                               .setIpFinder(new TcpDiscoveryVmIpFinder()//

                                                                               .setAddresses(clusterAddresses)

                                                                               .setShared(true))//

                                                               .setLocalAddress("127.0.0.1")//

                                                               .setLocalPort(port)//

                                                               .setLocalPortRange(2))

                                               .setCommunicationSpi(new TcpCommunicationSpi()//

                                                               .setMessageQueueLimit(1024)

                                                               .setLocalAddress("127.0.0.1")

                                                               .setLocalPort(commPort)

                                                               .setLocalPortRange(2))//

                                               .setConnectorConfiguration(new ConnectorConfiguration()

                                                               .setHost("127.0.0.1")

                                                               .setPort(connectorPort)

                                                               .setPortRange(2))

                                               .setClientConnectorConfiguration(new ClientConnectorConfiguration()

                                                               .setPort(clientPort)

                                                               .setPortRange(2));

 

                               IgniteEx ignite = (IgniteEx)Ignition.start(igniteCfg);

                              

                               ignite.cluster().state(ClusterState.ACTIVE);

 

                               return ignite;

                }

               

                /**

                *

                 */

                private IgniteCache<String, String> getKeyValue(Ignite ignite)

                {

                               return ignite.getOrCreateCache(new CacheConfiguration<String, String>()

                                                               .setName("permkv")

                                                               .setDataRegionName(PERSISTENT_REGION)

                                                               .setCacheMode(CacheMode.REPLICATED)

                                                               .setBackups(2));

                }

 

                /**

                *

                 */

                private IgniteCache<String, String> getInMemoryKeyValue(Ignite ignite)

                {

                               return ignite.getOrCreateCache(new CacheConfiguration<String, String>()

                                                               .setName("memkv")

                                                               .setCacheMode(CacheMode.REPLICATED)

                                                               .setDataRegionName(IN_MEMORY_REGION)

                                                               .setBackups(2));

                }

 

                /**

                * @param file

                */

                public static void rmrf(File file)

                {

                               if (file.isDirectory()) {

                                               for (File sub: file.listFiles()) {

                                                               String n = sub.getName();

                                                               if (".".equals(n) || "..".equals(n)) {

                                                                               continue;

                                                               }

                                                              

                                                               rmrf(sub);

                                               }

                               }

                              

                               log.debug("deleting "+file.getAbsolutePath());

                               file.delete();

                }

}

 

---

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

 

 

 

 
 
 
 
Zhenya Stanilovsky Zhenya Stanilovsky
Reply | Threaded
Open this post in threaded view
|

Re: Mixing persistent and in memory cache

In reply to this post by s.hesse@dicos.de

Sorry for previous, full_sync of course [1]
 
 

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<String, String> kva = getKeyValue(igA);

                               IgniteCache<String, String> kvb = getKeyValue(igB);

                              

                               kva.put("a", "aval");

                               Assert.assertEquals("aval", kvb.get("a"));

                }

 

                @Test

                public void testMem() throws InterruptedException

                {

                               log.info("#### "+new Exception().getStackTrace()[0].getMethodName());

                              

                               IgniteCache<String, String> kva = getInMemoryKeyValue(igA);

                               @SuppressWarnings("unused")

                               IgniteCache<String, String> kvb = getInMemoryKeyValue(igB);

                              

                               kva.put("a", "aval");

                              

                               Thread.sleep(1000);

                              

                               Assert.assertEquals("aval", kvb.get("a"));

                }

 

                /**

                *

                 */

                private IgniteEx startNode(String id, File datadir, int port, int commPort, int connectorPort, int clientPort)

                {

                               datadir.mkdirs();

                               String igniteDataDir = datadir.getAbsolutePath();

                              

                               DataRegionConfiguration persistentRegion = new DataRegionConfiguration()//

                                                                                              .setName(PERSISTENT_REGION)//

                                                                                              .setPersistenceEnabled(true);

                               DataRegionConfiguration inMemoryRegion = new DataRegionConfiguration()//

                                                                                              .setName(IN_MEMORY_REGION)//

                                                                                              .setPersistenceEnabled(false)//

                                                                                              ;

                              

                               List<String> clusterAddresses = Arrays.asList("127.0.0.1:47500..47501", "127.0.0.1:47505..47506");

                              

                               IgniteConfiguration igniteCfg = new IgniteConfiguration()//

                                               .setIgniteInstanceName(id)//

                                               .setWorkDirectory(igniteDataDir)//

                                               .setConsistentId("testcluster-"+id)//

                                               .setGridLogger(new Slf4jLogger())//

                                               .setMetricsLogFrequency(0)//

                                               .setDataStorageConfiguration(new DataStorageConfiguration()//

                                                               .setDefaultDataRegionConfiguration(persistentRegion)//

                                                               .setDataRegionConfigurations(inMemoryRegion))//

                                                               //.setDefaultDataRegionConfiguration(inMemoryRegion)//

                                                               //.setDataRegionConfigurations(persistentRegion))//

                                               .setDiscoverySpi(new TcpDiscoverySpi()//

                                                               .setIpFinder(new TcpDiscoveryVmIpFinder()//

                                                                               .setAddresses(clusterAddresses)

                                                                               .setShared(true))//

                                                               .setLocalAddress("127.0.0.1")//

                                                               .setLocalPort(port)//

                                                               .setLocalPortRange(2))

                                               .setCommunicationSpi(new TcpCommunicationSpi()//

                                                               .setMessageQueueLimit(1024)

                                                               .setLocalAddress("127.0.0.1")

                                                               .setLocalPort(commPort)

                                                               .setLocalPortRange(2))//

                                               .setConnectorConfiguration(new ConnectorConfiguration()

                                                               .setHost("127.0.0.1")

                                                               .setPort(connectorPort)

                                                               .setPortRange(2))

                                               .setClientConnectorConfiguration(new ClientConnectorConfiguration()

                                                               .setPort(clientPort)

                                                               .setPortRange(2));

 

                               IgniteEx ignite = (IgniteEx)Ignition.start(igniteCfg);

                              

                               ignite.cluster().state(ClusterState.ACTIVE);

 

                               return ignite;

                }

               

                /**

                *

                 */

                private IgniteCache<String, String> getKeyValue(Ignite ignite)

                {

                               return ignite.getOrCreateCache(new CacheConfiguration<String, String>()

                                                               .setName("permkv")

                                                               .setDataRegionName(PERSISTENT_REGION)

                                                               .setCacheMode(CacheMode.REPLICATED)

                                                               .setBackups(2));

                }

 

                /**

                *

                 */

                private IgniteCache<String, String> getInMemoryKeyValue(Ignite ignite)

                {

                               return ignite.getOrCreateCache(new CacheConfiguration<String, String>()

                                                               .setName("memkv")

                                                               .setCacheMode(CacheMode.REPLICATED)

                                                               .setDataRegionName(IN_MEMORY_REGION)

                                                               .setBackups(2));

                }

 

                /**

                * @param file

                */

                public static void rmrf(File file)

                {

                               if (file.isDirectory()) {

                                               for (File sub: file.listFiles()) {

                                                               String n = sub.getName();

                                                               if (".".equals(n) || "..".equals(n)) {

                                                                               continue;

                                                               }

                                                              

                                                               rmrf(sub);

                                               }

                               }

                              

                               log.debug("deleting "+file.getAbsolutePath());

                               file.delete();

                }

}

 

---

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

 

 

 

 
 
 
 
s.hesse@dicos.de s.hesse@dicos.de
Reply | Threaded
Open this post in threaded view
|

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<String, String> getInMemoryKeyValue(Ignite ignite)
        {
                return ignite.getOrCreateCache(new CacheConfiguration<String, String>()
                                .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/
Zhenya Stanilovsky Zhenya Stanilovsky
Reply | Threaded
Open this post in threaded view
|

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<String, String> kva = getInMemoryKeyValue(igA);
     
     IgniteCache<String, String> kvb = getInMemoryKeyValue(igB); ← here
for something like : IgniteCache<String, String> kvb = getInMemoryKeyValue2(igB);
 
private IgniteCache<String, String> getInMemoryKeyValue2(Ignite ignite)
 {
 return ignite.cache(new CacheConfiguration<String, String>() <--- 
 
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<String, String> getInMemoryKeyValue(Ignite ignite)
{
return ignite.getOrCreateCache(new CacheConfiguration<String, String>()
.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/
 
 
 
 
s.hesse@dicos.de s.hesse@dicos.de
Reply | Threaded
Open this post in threaded view
|

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:<aval> but was:<null>

        …

        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 <[hidden email]>
Sent: Friday, February 26, 2021 6:57 AM
To: [hidden email]
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<String, String> kva = getInMemoryKeyValue(igA);
     
     IgniteCache<String, String> kvb = getInMemoryKeyValue(igB); ← here

for something like : IgniteCache<String, String> kvb = getInMemoryKeyValue2(igB);

 

private IgniteCache<String, String> getInMemoryKeyValue2(Ignite ignite)
 {
 return ignite.cache(new CacheConfiguration<String, String>() <--- 

 

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<String, String> getInMemoryKeyValue(Ignite ignite)
{
return ignite.getOrCreateCache(new CacheConfiguration<String, String>()
.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/

 

 

 

 


testMem2.log (104K) Download Attachment
IgniteClusterTest.java (11K) Download Attachment
Zhenya Stanilovsky Zhenya Stanilovsky
Reply | Threaded
Open this post in threaded view
|

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:<aval> but was:<null>

        …

        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 <arzamas123@...>
Sent: Friday, February 26, 2021 6:57 AM
To: user@...
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<String, String> kva = getInMemoryKeyValue(igA);
     
     IgniteCache<String, String> kvb = getInMemoryKeyValue(igB); ← here

for something like : IgniteCache<String, String> kvb = getInMemoryKeyValue2(igB);

 

private IgniteCache<String, String> getInMemoryKeyValue2(Ignite ignite)
 {
 return ignite.cache(new CacheConfiguration<String, String>() <--- 

 

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<String, String> getInMemoryKeyValue(Ignite ignite)
{
return ignite.getOrCreateCache(new CacheConfiguration<String, String>()
.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/

 

 

 

 

 
 
 
 
s.hesse@dicos.de s.hesse@dicos.de
Reply | Threaded
Open this post in threaded view
|

RE: Re[4]: Mixing persistent and in memory cache

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 <[hidden email]>
Sent: Monday, March 1, 2021 7:15 AM
To: [hidden email]
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:<aval> but was:<null>

        …

        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 <arzamas123@...>
Sent: Friday, February 26, 2021 6:57 AM
To: user@...
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<String, String> kva = getInMemoryKeyValue(igA);
     
     IgniteCache<String, String> kvb = getInMemoryKeyValue(igB); ← here

for something like : IgniteCache<String, String> kvb = getInMemoryKeyValue2(igB);

 

private IgniteCache<String, String> getInMemoryKeyValue2(Ignite ignite)
 {
 return ignite.cache(new CacheConfiguration<String, String>() <--- 

 

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<String, String> getInMemoryKeyValue(Ignite ignite)
{
return ignite.getOrCreateCache(new CacheConfiguration<String, String>()
.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/

 

 

 

 

 

 

 

 


IgniteClusterTest.java (11K) Download Attachment
testMem2.log (104K) Download Attachment
Zhenya Stanilovsky Zhenya Stanilovsky
Reply | Threaded
Open this post in threaded view
|

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 <arzamas123@...>
Sent: Monday, March 1, 2021 7:15 AM
To: user@...
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:<aval> but was:<null>

        …

        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 <[hidden email]>
Sent: Friday, February 26, 2021 6:57 AM
To: [hidden email]
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<String, String> kva = getInMemoryKeyValue(igA);
     
     IgniteCache<String, String> kvb = getInMemoryKeyValue(igB); ← here

for something like : IgniteCache<String, String> kvb = getInMemoryKeyValue2(igB);

 

private IgniteCache<String, String> getInMemoryKeyValue2(Ignite ignite)
 {
 return ignite.cache(new CacheConfiguration<String, String>() <--- 

 

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<String, String> getInMemoryKeyValue(Ignite ignite)
{
return ignite.getOrCreateCache(new CacheConfiguration<String, String>()
.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/

 

 

 

 

 

 

 

 

 
 
 
 
s.hesse@dicos.de s.hesse@dicos.de
Reply | Threaded
Open this post in threaded view
|

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<ClusterNode> nodes = ignite.cluster().forServers().nodes();

ignite.cluster().setBaselineTopology(nodes);

 

or:

 

ignite.cluster().baselineAutoAdjustEnabled(true);

ignite.cluster().baselineAutoAdjustTimeout(30000);

 

 

 

---

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 <[hidden email]>
Sent: Tuesday, March 2, 2021 7:03 AM
To: [hidden email]
Subject: 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 <arzamas123@...>
Sent: Monday, March 1, 2021 7:15 AM
To: user@...
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:<aval> but was:<null>

        …

        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 <[hidden email]>
Sent: Friday, February 26, 2021 6:57 AM
To: [hidden email]
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<String, String> kva = getInMemoryKeyValue(igA);
     
     IgniteCache<String, String> kvb = getInMemoryKeyValue(igB); ← here

for something like : IgniteCache<String, String> kvb = getInMemoryKeyValue2(igB);

 

private IgniteCache<String, String> getInMemoryKeyValue2(Ignite ignite)
 {
 return ignite.cache(new CacheConfiguration<String, String>() <--- 

 

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<String, String> getInMemoryKeyValue(Ignite ignite)
{
return ignite.getOrCreateCache(new CacheConfiguration<String, String>()
.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/