-Re: SolrCloud and split-brain
Otis Gospodnetic 2012-06-16, 02:33
The reason I asked this is because I saw mentions of SolrCloud being resilient to split brain because it uses ZooKeeper.
However, if my half brain understands what split brain is then I think that's not a completely true claim because one can get unlucky and get a SolrCloud cluster partitioned in a way that one or even all partitions reject indexing (and update and deletion) requests if they do not have a complete index.
In my example of a 10-node cluster that gets split into a 7-node and a 3-node partition, if neither partition ends up containing the full index (i.e. at least one copy of each shard) then neither partition will accept updates.
And here is one more Q.
* Imagine a client is adding documents and, for simplicity, imagine SolrCloud routes all these documents to the same shard, call it S.
* Imagine that both the 7-node and the 3-node partition end up with a complete index and thus both accept updates.
* This means that both the 7-node and the 3-node partition have at least one replica of shard S, lets call then S7 and S3.
* Now imagine if the client sending documents for indexing happened to be sending documents to 2 nodes, say in round-robin fashion.
* And imagine that each of these 2 nodes ended up in a different partition.
The client now keeps sending docs to these 2 nodes and both happily take and index documents in their own copies of S.
To the client everything looks normal - all documents are getting indexed.
But S7 and S3 are no longer the same - they contain different documents!
What happens with somebody fixes the cluster and all nodes are back in the same 10-node cluster? What happens to S7 and S3?
Wouldn't SolrCloud have to implement bi-directional synchronization to fix things and "unify" S7 and S3?
And if there are updates and deletes involved, things get even messier.... :(
Performance Monitoring for Solr / ElasticSearch / HBase - http://sematext.com/spm
----- Original Message -----
> From: Mark Miller <[EMAIL PROTECTED]>
> To: solr-user <[EMAIL PROTECTED]>
> Sent: Friday, June 15, 2012 5:07 PM
> Subject: Re: SolrCloud and split-brain
> On Jun 15, 2012, at 3:21 PM, Otis Gospodnetic wrote:
>> Thanks Mark, will open an issue in a bit.
>> But I think the following is the real meat of the Q about split brain and
> SolrCloud, especially when it comes to how indexing is handled during split
>>>> Does this work even when outside clients (apps for indexing or
>>> send their requests directly to individual nodes?
>>>> Let's use the example from my email where we end up with 2
> groups of
>>> nodes: 7-node group with 2 ZK nodes on the same network and 3-node
> group with 1
>>> ZK node on the same network.
>>> The 3-node group with 1 ZK would not have a functioning zk - so it
> would stop
>>> accepting updates. If it could serve a complete view of the index, it
>>> though, for searches.
>> So in this case information in this 1 ZK node would tell the 3 Solr nodes
> whether they have all index data or if some shards are missing (i.e. were only
> on nodes in the other 7-node group)?
>> And if nodes figure out they don't have all index data they will reject
> search requests? Or will they accept and perform searches, but return responses
> that tell the client that the searched index was not complete?
> The 1 ZK node will not function, so the 3 Solr nodes will not accept updates.
> If there is one replica for each shard available, search will still work. I
> don't think partial results has been committed yet for distrib search. In
> that case, we will put something in the header to indicate a full copy of the
> index was not available. I think we can also add something in the header if we
> know we cannot talk to zookeeper to let the client know it could be seeing stale
> state. SmartClients that talked to zookeeper would see those nodes appear as