The "Unavailable shared for ranges" error is a common problem seen and usually caused by replication problems
The following error is seen by an application querying the cluster
ERROR [http-8983-2] 2015-01-16 13:49:43,467 SolrDispatchFilter.java (line 696) Error request exception: java.io.IOException: Unavailable shards for ranges: [(-57 java.lang.RuntimeException: java.io.IOException: Unavailable shards for ranges: [(-5719401877638111419,-5707784632754930432], (-2818664767592173043,-280161088540 at com.datastax.bdp.search.solr.handler.shard.CassandraHttpShardHandler.checkDistributed(CassandraHttpShardHandler.java:44) at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:178) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1882) <...truncated...>
This is usually caused by a replication issue. It is usually:
- Some nodes with the replicas are genuinely down and not able to respond to the query
- Some nodes are experiencing high GC pauses thus not responding to the query (see this note for more info: Common causes of GC pauses)
- The keyspace replication strategy is not correct (i.e using SimpleStrategy in a multi-DC environment - the writes only going into one DC but reads might try to target multiple DCs)
- The keyspace replication configured with DC names that do not match the current cluster configuration.
- The query is requesting a higher consistency level read than the cluster can service at the current time
In some cases changing the read consistency level to a lower one might help to mitigate the issue. Be aware that using a low setting like CL=ONE might mean the data returned is not completely consistent
Check you are using the correct replication strategy, and check the status of your cluster addressing any nodes that might be reported as down or unresponsive.