SOLR-8701: CloudSolrClient decides that there are no healthy nodes to handle a request too early.

This commit is contained in:
markrmiller 2016-02-19 08:02:12 -05:00
parent 6ccb43a7b7
commit c4d31798cc
2 changed files with 11 additions and 7 deletions

View File

@ -179,6 +179,9 @@ Bug Fixes
* SOLR-8416: The collections create API should return after all replicas are active. * SOLR-8416: The collections create API should return after all replicas are active.
(Michael Sun, Mark Miller, Alexey Serba) (Michael Sun, Mark Miller, Alexey Serba)
* SOLR-8701: CloudSolrClient decides that there are no healthy nodes to handle a request too early.
(Mark Miller)
Optimizations Optimizations
---------------------- ----------------------
* SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been * SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been

View File

@ -1077,12 +1077,6 @@ public class CloudSolrClient extends SolrClient {
theUrlList = new ArrayList<>(urlList.size()); theUrlList = new ArrayList<>(urlList.size());
theUrlList.addAll(urlList); theUrlList.addAll(urlList);
} }
if(theUrlList.isEmpty()) {
for (String s : collectionNames) {
if(s!=null) collectionStateCache.remove(s);
}
throw new SolrException(SolrException.ErrorCode.INVALID_STATE, "Could not find a healthy node to handle the request.");
}
Collections.shuffle(theUrlList, rand); Collections.shuffle(theUrlList, rand);
if (sendToLeaders) { if (sendToLeaders) {
@ -1093,6 +1087,13 @@ public class CloudSolrClient extends SolrClient {
theUrlList.addAll(theReplicas); theUrlList.addAll(theReplicas);
} }
if (theUrlList.isEmpty()) {
for (String s : collectionNames) {
if (s != null) collectionStateCache.remove(s);
}
throw new SolrException(SolrException.ErrorCode.INVALID_STATE,
"Could not find a healthy node to handle the request.");
}
} }
LBHttpSolrClient.Req req = new LBHttpSolrClient.Req(request, theUrlList); LBHttpSolrClient.Req req = new LBHttpSolrClient.Req(request, theUrlList);