-
1. Re: switch off/on the communication between nodes when it is in clustering modes?
dan.berindei Apr 6, 2011 4:48 AM (in response to amalrajvinoth)Stopping the communication between nodes is normally seen as a bad thing, because when communication is reestablished you will have to reconcile the modifications on the separate partitions (in your case it would require a 3-way merge). That's why it's not supported directly in Infinispan.
If you just want to run tests to see what would happen, I suggest binding Infinispan to a dedicated network interface and disabling/enabling that network interface externally.
As a possible alternative it looks like JChannel supports restarts, so you might be able to do something like this:
RpcManagerImpl rpcManager = (RpcManagerImpl) advancedCache.getRpcManager();
JGroupsTransport transport = (JGroupsTransport) rpcManager.getTransport();
JChannel channel = transport.getChannel();
channel.stop();
Thread.sleep(1000);
channel.start();
Note that this is not a supported scenario and I haven't actually run the code, so it is very likely that it doesn't work and it blows up instead.
-
2. switch off/on the communication between nodes when it is in clustering modes?
dan.berindei Apr 6, 2011 11:32 AM (in response to dan.berindei)I just learned there is a better way to test a network failure: inserting a DISCARD protocol in the JGroups protocol stack.
See https://github.com/infinispan/infinispan/blob/master/core/src/test/java/org/infinispan/notifications/MergeViewTest.java for an example.