On 5 Apr 2013, at 15:53, Manik Surtani wrote:
1. We write a SplitBrainListener which is registered when the
channel connects. The aim of this listener is to identify when we have a partition. This
can be identified when a view change is detected, and the new view is significantly
smaller than the old view. Easier to detect for large clusters, but smaller clusters will
be harder - trying to decide between a node leaving vs a partition. (Any better ideas
here?)
2. The SBL flips a switch in an interceptor (SplitBrainHandlerInterceptor?) which
switches the node to be read-only (reject invocations that change the state of the local
node) if it is in the smaller partition (newView.size < oldView.size / 2). Only works
reliably for odd-numbered cluster sizes, and the issues with small clusters seen in (1)
will affect here as well.
3. The SBL can flip the switch in the interceptor back to normal operation once a
MergeView is detected.
It's no way near perfect but at least it means that we can recommend enabling this
and setting up an odd number of nodes, with a cluster size of at least N if you want to
reduce inconsistency in your grid during partitions.
would the read only partition
be wiped out and repopulated during merge? Otherwise not sure how useful this is as
there'll still going to be inconsistencies in the cluster, the same way there
currently are with a merge, but fewer.
Cheers,
--
Mircea Markus
Infinispan lead (
www.infinispan.org)