0
votes

When an object is fetched from the persistence store by Ignite's cache using CacheStore, its backup copy is not created.

Can someone tell me how that back up works in Ignite for above scenario?

My Configuration:

  • Use cluster of two Ignite servers.
  • Cache properties.

cacheConfig.setWriteThrough(true);
cacheConfig.setReadThrough(true);
cacheConfig.setBackups(1);
cacheConfig.setWriteBehindEnabled(true);           
cacheConfig.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_ASYNC);
cacheConfig.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);           
cacheConfig.setCacheStoreFactory(FactoryBuilder.factoryOf(ObjectLoader.class));
1
How do you check that backup is not created? Could you post a piece of code that you use to check it? Just in case, here is documentation on primary and backup cache nodes: apacheignite.readme.io/v2.1/docs/primary-and-backup-copies - Denis
I have used console gridgain tool to check back up copies. - Rhishi
To check backup and primary size use following code 1)cache.sizeLong(CachePeekMode.BACKUP) 2)cache.sizeLong(CachePeekMode.PRIMARY) - Rhishi

1 Answers

0
votes

When you create a cache with a configured cache store, data loading is performed by cache in a lazy manner. In your configuration you enabled read-through, so only that values that you actually read will be loaded from the cache store.

If you want to make sure that your cache has a backup copy, you have a few options: