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 2020/11/14 00:16:50 UTC

[lucene-solr] branch reference_impl_dev updated (6a37309 -> cbdbe8d)

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a change to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from 6a37309  @1185 Harden test.
     new 5eced57  @1186 Bring that back in.
     new 8f29964  @1187 Short term fix.
     new cbdbe8d  @1188 More shuffling.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java  |  8 ++++----
 .../apache/solr/client/solrj/impl/BaseCloudSolrClient.java    | 11 +++++++----
 .../org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java  |  2 +-
 3 files changed, 12 insertions(+), 9 deletions(-)


[lucene-solr] 01/03: @1186 Bring that back in.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 5eced57a0ebe8955865a90066b7a277c4e926d1e
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Fri Nov 13 17:50:29 2020 -0600

    @1186 Bring that back in.
---
 solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
index 1800166..d5c5984 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -468,10 +468,10 @@ public class HttpSolrCall {
     Map<String,Integer> invalidStates = checkStateVersionsAreValid(queryParams.get(CloudSolrClient.STATE_VERSION));
     if (coreUrl != null
         && queryParams.get(DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM) == null) {
-//      if (invalidStates != null) {
-//        //it does not make sense to send the request to a remote node
-//        throw new SolrException(SolrException.ErrorCode.INVALID_STATE, new String(Utils.toJSON(invalidStates), org.apache.lucene.util.IOUtils.UTF_8));
-//      }
+      if (invalidStates != null) {
+        //it does not make sense to send the request to a remote node
+        throw new SolrException(SolrException.ErrorCode.INVALID_STATE, new String(Utils.toJSON(invalidStates), org.apache.lucene.util.IOUtils.UTF_8));
+      }
       action = REMOTEQUERY;
     } else {
       if (!retry) {


[lucene-solr] 02/03: @1187 Short term fix.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 8f2996484ce14a2fe31f72f432176178fed334b1
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Fri Nov 13 18:05:25 2020 -0600

    @1187 Short term fix.
---
 .../java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java   | 4 ++--
 .../src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
index bb3d42d..6be6a15 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
@@ -945,7 +945,7 @@ public abstract class BaseCloudSolrClient extends SolrClient {
       }
     } catch (Exception exc) {
       ParWork.propagateInterrupt("Request failed", exc);
-      Throwable rootCause = SolrException.getRootCause(exc);
+      Throwable rootCause = SolrException.getRootCause(exc); // TODO: with http2solrclient, we are getting remoteexception here instead of real root
       // don't do retry support for admin requests
       // or if the request doesn't have a collection specified
       // or request is v2 api and its method is not GET
@@ -968,7 +968,7 @@ public abstract class BaseCloudSolrClient extends SolrClient {
       boolean wasCommError =
           (rootCause instanceof ConnectException ||
               rootCause instanceof SocketException ||
-              wasCommError(rootCause));
+              wasCommError(rootCause) || rootCause.getMessage().contains("Connection refused"));
 
       log.error("Request to collection {} failed due to ({}) {}, retry={} commError={} errorCode={} ",
           inputCollections, errorCode, rootCause, retryCount, wasCommError, errorCode);
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java
index e1e8ac2..90bfa7f 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java
@@ -183,7 +183,7 @@ public class LBHttp2SolrClient extends LBSolrClient {
         } catch (SolrException e) {
           // we retry on 404 or 403 or 503 or 500
           // unless it's an update - then we only retry on connect exception
-          if (!isNonRetryable && RETRY_CODES.contains(e.code())) {
+          if (!isNonRetryable && (RETRY_CODES.contains(e.code()) || e.getMessage().contains("Connection refused"))) {
             listener.onFailure((!isZombie) ? addZombie(baseUrl, e) : e, true);
           } else {
             // Server is alive but the request was likely malformed or invalid


[lucene-solr] 03/03: @1188 More shuffling.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit cbdbe8d07ea8ff5772ca26ac136c6c46a6f22df3
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Fri Nov 13 18:08:54 2020 -0600

    @1188 More shuffling.
---
 .../org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
index 6be6a15..eeab56c 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
@@ -1172,7 +1172,8 @@ public abstract class BaseCloudSolrClient extends SolrClient {
         if (col == null) {
           throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Collection not found: " + collectionName);
         }
-        Collection<Slice> routeSlices = col.getRouter().getSearchSlices(shardKeys, reqParams , col);
+        List<Slice> routeSlices = new ArrayList<>(col.getRouter().getSearchSlices(shardKeys, reqParams , col));
+        Collections.shuffle(routeSlices);
         ClientUtils.addSlices(slices, collectionName, routeSlices, true);
       }
 
@@ -1181,7 +1182,9 @@ public abstract class BaseCloudSolrClient extends SolrClient {
       List<Replica> replicas = new ArrayList<>();
       for (Slice slice : slices.values()) {
         Replica leader = slice.getLeader();
-        for (Replica replica : slice.getReplicas()) {
+        ArrayList<Replica> replicaList = new ArrayList<>(slice.getReplicas());
+        Collections.shuffle(replicaList);
+        for (Replica replica : replicaList) {
           String node = replica.getNodeName();
           if (!liveNodes.contains(node) // Must be a live node to continue
               || replica.getState() != Replica.State.ACTIVE) // Must be an ACTIVE replica to continue