JE HA:Can a Master transition state to Unknown instead of throwing IRE?
Hello
JE 5.0.48
I am running tests using the StockQuotes example with a cluster of four nodes. I have a question about the behaviour of the cluster as replicas are killed.
I start four nodes, n1, n2, n3, n4. n1 is elected Master. n2 - n4 become replicas.
If I kill n3, n1 remains master and writes are still permitted as there are sufficient replicas to satisfy the SIMPLE_MAJORITY policy. If I then go on to kill n4, n1 still remains master but InsufficientReplicasException is thrown in response to each write. I see in the documentation this is expected behaviour.
In our use case, we would like to know immediately when the number of replicas becomes too few to satisfy the ReplicaAckPolicy, rather than waiting for the next transaction to fail with InsufficientReplicasException. We wonder if there is a way to organise for the Master to transition back to Unknown when this condition arises. If this is not possible, is it possible for the application to learn of this in the other way? I have read about Monitor.startListener() and MonitorChangeListener. Could these help us?
Any advice would be much appreciated.
Kind regards, Keith Wall.