2

I'm migrating the project to Infinispan 9.1.0.Final from 8.2.4.Final and got next exception:

org.infinispan.commons.CacheConfigurationException: ISPN000441: Unsupported async cache mode 'REPL_ASYNC' for transactional caches

Related code:

new ConfigurationBuilder()
            .jmxStatistics()
            .enabled(false)
            .available(false)
            .clustering()
            .cacheMode(CacheMode.REPL_ASYNC)
            .stateTransfer().awaitInitialTransfer(false)
            .transaction()
            .transactionManagerLookup(new DummyTransactionManagerLookup())
            .transactionMode(TransactionMode.TRANSACTIONAL)
            .lockingMode(LockingMode.PESSIMISTIC)
            .recovery()
            .enabled(false)
            .invocationBatching()
            .enable(false)
            .indexing()
            .index(Index.ALL)
            .addProperty("default.indexmanager", "near-real-time")
            .addProperty("default.directory_provider", "ram")
            .addProperty("default.worker.execution", "sync")
            .addProperty("default.exclusive_index_use", "true")
            .addProperty("default.reader.strategy", "shared")
            .build();

And problem combination here, but in 8.2.4.Final version this works well.

.cacheMode(CacheMode.REPL_ASYNC)
.transactionMode(TransactionMode.TRANSACTIONAL) // Maybe is there another way to lock put operations?

How should I reconfig cache to save its characteristics?

1 Answers1

2

The async mode for transactional caches wasn't safe since it didn't wait for the transaction to commit in every node in the cluster before reporting to the TransactionManager. It can make your data inconsistent if you are unlucky.

To avoid any issues, it was removed. Please upgrade your configuration to use REPL_SYNC instead.

Also, the DummyTransactionManagerLookup was deprecated and it should be replaced by EmbeddedTransactionManagerLookup.

There are other transaction related change between 8.x and 9.x. Please take a look at the upgrade guide (http://infinispan.org/docs/stable/upgrading/upgrading.html#upgrading_from_8_x_to_9_0) for more details.

pruivo
  • 1,214
  • 7
  • 7
  • It is working solution, but the application very often puts elements to part of the distributed cache, and now, with REPL_ASYNC, updated node informs other ones about this event. And they update own cache instances automatically. With REPL_SYNC requested node must ask other to give fresh element, therefore put's latency will be suffitiently increased. What can you suggest? – Nikita Sokolov Jul 25 '17 at 11:17
  • I'm not sure if I understand your use case, but do you really transaction? Non-transactional caches can still use the async mode. If you don't need the previous value from the put(k,v), you can set the IGNORE_RETURN_VALUES like: AdvanceCache.withFlags(IGNORE_RETURN_VALUES).put(k,v), but it sill needs to go remote to acquire the lock (if the node isn't the lock owner). – pruivo Jul 25 '17 at 13:12