You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2016/02/19 14:51:51 UTC

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

Repository: lucene-solr
Updated Branches:
  refs/heads/master 6ccb43a7b -> c4d31798c


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


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c4d31798
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c4d31798
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c4d31798

Branch: refs/heads/master
Commit: c4d31798cc79fabf3b7cee4757eb39367461633e
Parents: 6ccb43a
Author: markrmiller <ma...@apache.org>
Authored: Fri Feb 19 08:02:12 2016 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Fri Feb 19 08:51:19 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                       |  5 ++++-
 .../apache/solr/client/solrj/impl/CloudSolrClient.java | 13 +++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c4d31798/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 2e33827..953b2d4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -178,7 +178,10 @@ Bug Fixes
 
 * SOLR-8416: The collections create API should return after all replicas are active.
   (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
 ----------------------
 * SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c4d31798/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
index 0973475..59b37c5 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
@@ -1077,12 +1077,6 @@ public class CloudSolrClient extends SolrClient {
         theUrlList = new ArrayList<>(urlList.size());
         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);
       if (sendToLeaders) {
@@ -1093,6 +1087,13 @@ public class CloudSolrClient extends SolrClient {
         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);