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 2021/02/10 16:35:49 UTC

[lucene-solr] branch reference_impl_dev updated: @1339 Fix MoveReplicaTest perf issue.

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


The following commit(s) were added to refs/heads/reference_impl_dev by this push:
     new df57463  @1339 Fix MoveReplicaTest perf issue.
df57463 is described below

commit df57463fe28cc7df741b8551b7b402d88d78bc45
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Wed Feb 10 10:33:40 2021 -0600

    @1339 Fix MoveReplicaTest perf issue.
---
 solr/core/src/java/org/apache/solr/api/V2HttpCall.java   |  6 +++---
 .../src/java/org/apache/solr/cloud/ZkController.java     |  4 +++-
 .../src/java/org/apache/solr/core/CoreContainer.java     |  9 ---------
 .../org/apache/solr/handler/admin/PrepRecoveryOp.java    |  3 ++-
 .../src/java/org/apache/solr/servlet/HttpSolrCall.java   | 15 ++++++++-------
 .../test/org/apache/solr/handler/TestBlobHandler.java    |  4 +++-
 .../java/org/apache/solr/common/cloud/ZkStateReader.java | 16 ++++++++++++----
 7 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
index 818be5d..c6dd47d 100644
--- a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
+++ b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
@@ -122,9 +122,9 @@ public class V2HttpCall extends HttpSolrCall {
           if (core == null) {
             //this collection exists , but this node does not have a replica for that collection
             if (log.isDebugEnabled()) log.debug("check remote path extraction {} {}", collection.getName(), origCorename);
-            if (origCorename != null) {
-              extractRemotePath(null, origCorename);
-            }
+//            if (origCorename != null) {
+//              extractRemotePath(null, origCorename);
+//            }
             if (origCorename == null || collection.getName().equals(origCorename)) {
               extractRemotePath(collection.getName(), null);
             }
diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
index b871421..922e19e 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
@@ -2109,7 +2109,9 @@ public class ZkController implements Closeable, Runnable {
       zkClient.getSolrZooKeeper().removeWatches(COLLECTIONS_ZKNODE, confListeners.watcher, Watcher.WatcherType.Any, true, (rc, path, ctx) -> {
         if (rc != 0) {
           KeeperException ex = KeeperException.create(KeeperException.Code.get(rc), path);
-          log.error("Exception removing watch for " + path, ex);
+          if (!(ex instanceof KeeperException.NoWatcherException)) {
+            log.error("Exception removing watch for " + path, ex);
+          }
         }
       }, "confWatcher");
       confDirectoryListeners.remove(confDir);
diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index 584ea16..03b9385 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -2023,15 +2023,6 @@ public class CoreContainer implements Closeable {
 
       if (isZooKeeperAware()) {
         getZkController().stopReplicationFromLeader(name);
-
-        try {
-          zkSys.getZkController().unregister(name, cd.getCollectionName(), cd.getCloudDescriptor().getShardId());
-        } catch (AlreadyClosedException e) {
-
-        } catch (Exception e) {
-          log.error("Error unregistering core [" + name + "] from cloud state", e);
-          exception = new SolrException(ErrorCode.SERVER_ERROR, "Error unregistering core [" + name + "] from cloud state", e);
-        }
       }
 
 
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/PrepRecoveryOp.java b/solr/core/src/java/org/apache/solr/handler/admin/PrepRecoveryOp.java
index 4a6da71..6c6127e 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/PrepRecoveryOp.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/PrepRecoveryOp.java
@@ -101,7 +101,8 @@ class PrepRecoveryOp implements CoreAdminHandler.CoreAdminOp {
 
     LeaderElector leaderElector = it.handler.coreContainer.getZkController().getLeaderElector(leaderName);
     if (leaderElector == null || !leaderElector.isLeader()) {
-      throw new IllegalStateException("Not the valid leader " + (leaderElector == null ? "No leader elector" : "Elector state=" + leaderElector.getState()) + " coll=" + it.handler.getCoreContainer().getZkController().getClusterState().getCollectionOrNull(collection));
+      throw new IllegalStateException("Not the valid leader (replica=" + leaderName + ")" + (leaderElector == null ? "No leader elector" : "Elector state=" + leaderElector.getState()) +
+          " coll=" + it.handler.getCoreContainer().getZkController().getClusterState().getCollectionOrNull(collection));
     }
   }
 }
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 417b9b9..0182c87 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -305,9 +305,9 @@ public class HttpSolrCall {
           // if we couldn't find it locally, look on other nodes
           if (idx > 0) {
             if (log.isDebugEnabled()) log.debug("check remote path extraction {} {}", collectionName, origCorename);
-            if (origCorename != null) {
-              extractRemotePath(null, origCorename);
-            }
+//            if (origCorename != null) {
+//              extractRemotePath(null, origCorename);
+//            }
             if (origCorename == null || collectionName.equals(origCorename)) {
               extractRemotePath(collectionName, null);
             }
@@ -401,13 +401,13 @@ public class HttpSolrCall {
       if (rsp.getValues().get("success") == null) {
         throw new SolrException(ErrorCode.SERVER_ERROR, "Could not auto-create " + SYSTEM_COLL + " collection: "+ Utils.toJSONString(rsp.getValues()));
       }
-      TimeOut timeOut = new TimeOut(3, TimeUnit.SECONDS, TimeSource.NANO_TIME);
+      TimeOut timeOut = new TimeOut(1, TimeUnit.SECONDS, TimeSource.NANO_TIME);
       for (; ; ) {
         if (cores.getZkController().getClusterState().getCollectionOrNull(SYSTEM_COLL) != null) {
           break;
         } else {
           if (timeOut.hasTimedOut()) {
-            throw new SolrException(ErrorCode.SERVER_ERROR, "Could not find " + SYSTEM_COLL + " collection even after 3 seconds");
+            throw new SolrException(ErrorCode.SERVER_ERROR, "Could not find " + SYSTEM_COLL + " collection even after 1 second");
           }
           timeOut.sleep(50);
         }
@@ -493,8 +493,8 @@ public class HttpSolrCall {
     } else {
       if (!retry) {
         // we couldn't find a core to work with, try reloading aliases & this collection
-        cores.getZkController().getZkStateReader().aliasesManager.update();
-        action = RETRY;
+//        cores.getZkController().getZkStateReader().aliasesManager.update();
+//        action = RETRY;
       }
     }
   }
@@ -1062,6 +1062,7 @@ public class HttpSolrCall {
 
     ClusterState clusterState = zkStateReader.getClusterState();
     DocCollection collection = clusterState.getCollectionOrNull(collectionName);
+
     if (collection == null) {
       return null;
     }
diff --git a/solr/core/src/test/org/apache/solr/handler/TestBlobHandler.java b/solr/core/src/test/org/apache/solr/handler/TestBlobHandler.java
index ab539d3..37b0b75 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestBlobHandler.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestBlobHandler.java
@@ -175,7 +175,9 @@ public class TestBlobHandler extends AbstractFullDistribZkTestBase {
       try {
         response = resp.asString;
         Map m = (Map) fromJSONString(response);
-        assertFalse("Error in posting blob " + m.toString(), m.containsKey("error"));
+        if (m != null) {
+          assertFalse("Error in posting blob " + m.toString(), m.containsKey("error"));
+        }
       } catch (JSONParser.ParseException e) {
         log.error("$ERROR$: {}", response, e);
         fail();
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
index 8ed397c..1318413 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
@@ -1430,14 +1430,18 @@ public class ZkStateReader implements SolrCloseable, Replica.NodeNameToBaseUrl {
       zkClient.getSolrZooKeeper().removeWatches(collectionCSNPath, this, WatcherType.Any, true, (rc, path, ctx) -> {
         if (rc != 0) {
           KeeperException ex = KeeperException.create(KeeperException.Code.get(rc), path);
-          log.error("Exception removing watch for " + path, ex);
+          if (!(ex instanceof KeeperException.NoWatcherException)) {
+            log.error("Exception removing watch for " + path, ex);
+          }
         }
       }, "collectionStateWatcher:" + coll);
 
       zkClient.getSolrZooKeeper().removeWatches(stateUpdateWatcher.stateUpdatesPath, stateUpdateWatcher, WatcherType.Any, true, (rc, path, ctx) -> {
         if (rc != 0) {
           KeeperException ex = KeeperException.create(KeeperException.Code.get(rc), path);
-          log.error("Exception removing watch for " + path, ex);
+          if (!(ex instanceof KeeperException.NoWatcherException)) {
+            log.error("Exception removing watch for " + path, ex);
+          }
         }
       }, "collectionStateUpdatesWatcher:" + coll);
     }
@@ -1827,7 +1831,9 @@ public class ZkStateReader implements SolrCloseable, Replica.NodeNameToBaseUrl {
       zkClient.getSolrZooKeeper().removeWatches(COLLECTIONS_ZKNODE, this, WatcherType.Any, true, (rc, path, ctx) -> {
         if (rc != 0) {
           KeeperException ex = KeeperException.create(KeeperException.Code.get(rc), path);
-          log.error("Exception removing watch for " + path, ex);
+          if (!(ex instanceof KeeperException.NoWatcherException)) {
+            log.error("Exception removing watch for " + path, ex);
+          }
         }
       }, "collectionsChildWatcher");
     }
@@ -1885,7 +1891,9 @@ public class ZkStateReader implements SolrCloseable, Replica.NodeNameToBaseUrl {
       zkClient.getSolrZooKeeper().removeWatches(LIVE_NODES_ZKNODE, this, WatcherType.Any, true, (rc, path, ctx) -> {
         if (rc != 0) {
           KeeperException ex = KeeperException.create(KeeperException.Code.get(rc), path);
-          log.error("Exception removing watch for " + path, ex);
+          if (!(ex instanceof KeeperException.NoWatcherException)) {
+            log.error("Exception removing watch for " + path, ex);
+          }
         }
       }, "liveNodesWatcher");
     }