0

I have two instances of Infinispan replicated in two Kubernetes pods. In Infinispan, I have one replicated cache C on both the instances.

When I use the Infinispan Java API removeCache() on the cache C from an external Java application (registered to the C cache), I see that just 1/2 Infinispan pods remove that cache, while the other pod still contains it (and then, the application points now to that remaining replica).

Is there a way to delete all the replicated caches through an Infinispan Java API? Or, a way to sync this API call through all the replicated caches?

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
  • the `removeCache()` method removes the cache from all nodes. are you getting any exceptions? how are you checking if the cache is still running or not? – pruivo May 11 '21 at 15:48
  • In the Infinispan pod there's a built-in script which allows to query the caches. So, when I use the `removeCache()` I enter in both the pods and using that script I see that just one of them does not have the cache **C**, while the other one still has it. It looks like that the `removeCache()` works just on the pod handling the Java application API requests. No exceptions are shown in the logs. I'm using the docker image jboss-infinispan-server:12.1.0 – user7441088 May 12 '21 at 06:25
  • The script is actually the CLI of Infinispan (from the pod is `bin/cli.sh`). – user7441088 May 12 '21 at 06:33
  • can you share the steps to reproduce? how are you starting the pods? – pruivo May 12 '21 at 14:27
  • @Theta if you are defining the caches in the server XML, `removeCache()` will not remove the cache on all the servers. See also https://stackoverflow.com/questions/67469118/hot-rod-java-client-removecache-replicated-cache/67555312#67555312 – Dan Berindei May 16 '21 at 10:06

1 Answers1

0

If you use Infinispan 10 or better only caches created with the cli or other admin interface can be removed (persistent) from the configuration. If the server/conf/infinispan*.xml is used it will have no effect clusterwide and a restart will bring the cache back.

With the latest Infinispan version there should be no issue, if you any of the admin interfaces the cache will be created and removed cluster wide.

Note that you can not modify caches here at the moment, this is a feature in future releases 13+

wfink
  • 347
  • 1
  • 6