lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject [42/50] [abbrv] lucene-solr:master: SOLR-11076: Added more debug logging. Ensure collections are active before we exercise autoscaling. Added workaround for SOLR-9440.
Date Wed, 04 Oct 2017 08:25:34 GMT
SOLR-11076: Added more debug logging. Ensure collections are active before we exercise autoscaling.
Added workaround for SOLR-9440.


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

Branch: refs/heads/master
Commit: 5982d8734adf44e12cae1985574ca682f07839ca
Parents: ac9ee36
Author: Shalin Shekhar Mangar <shalin@apache.org>
Authored: Fri Sep 22 13:27:24 2017 -0700
Committer: Shalin Shekhar Mangar <shalin@apache.org>
Committed: Fri Sep 22 13:27:24 2017 -0700

----------------------------------------------------------------------
 .../solr/cloud/autoscaling/ComputePlanAction.java    |  7 ++++++-
 .../handler/admin/AutoscalingHistoryHandlerTest.java | 15 ++++++++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5982d873/solr/core/src/java/org/apache/solr/cloud/autoscaling/ComputePlanAction.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/autoscaling/ComputePlanAction.java b/solr/core/src/java/org/apache/solr/cloud/autoscaling/ComputePlanAction.java
index 93441fe..5d5e3eb 100644
--- a/solr/core/src/java/org/apache/solr/cloud/autoscaling/ComputePlanAction.java
+++ b/solr/core/src/java/org/apache/solr/cloud/autoscaling/ComputePlanAction.java
@@ -20,6 +20,7 @@ package org.apache.solr.cloud.autoscaling;
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -61,7 +62,11 @@ public class ComputePlanAction extends TriggerActionBase {
           return;
         }
         Policy policy = autoScalingConf.getPolicy();
-        Policy.Session session = policy.createSession(new SolrClientDataProvider(cloudSolrClient));
+        SolrClientDataProvider dataProvider = new SolrClientDataProvider(cloudSolrClient);
+        if (log.isDebugEnabled()) {
+          log.debug("Cluster data provider: {}", dataProvider.toMap(new HashMap<>()));
+        }
+        Policy.Session session = policy.createSession(dataProvider);
         Policy.Suggester suggester = getSuggester(session, event, zkStateReader);
         while (true) {
           SolrRequest operation = suggester.getOperation();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5982d873/solr/core/src/test/org/apache/solr/handler/admin/AutoscalingHistoryHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/AutoscalingHistoryHandlerTest.java
b/solr/core/src/test/org/apache/solr/handler/admin/AutoscalingHistoryHandlerTest.java
index ff6a916..39dd5a7 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/AutoscalingHistoryHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/AutoscalingHistoryHandlerTest.java
@@ -37,7 +37,7 @@ import static org.apache.solr.cloud.autoscaling.AutoScalingHandlerTest.createAut
 /**
  *
  */
-@LogLevel("org.apache.solr.cloud.autoscaling=DEBUG")
+@LogLevel("org.apache.solr.cloud.autoscaling=DEBUG;org.apache.solr.cloud.Overseer=DEBUG;org.apache.solr.cloud.overseer=DEBUG;")
 public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
@@ -162,6 +162,14 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase
{
 
   @Test
   public void testHistory() throws Exception {
+    waitForState("Timed out wait for collection be active", PREFIX + "_collection",
+        clusterShape(1, 3));
+    waitForState("Timed out wait for collection be active", CollectionAdminParams.SYSTEM_COLL,
+        clusterShape(1, 3));
+    // todo remove this workaround after SOLR-9440
+    cluster.getSolrClient().getZkStateReader().registerCore(".system");
+    cluster.getSolrClient().getZkStateReader().registerCore(PREFIX + "_collection");
+
     JettySolrRunner jetty = cluster.startJettySolrRunner();
     String nodeAddedName = jetty.getNodeName();
     boolean await = actionFiredLatch.await(60, TimeUnit.SECONDS);
@@ -178,6 +186,11 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase
{
     query = params(CommonParams.QT, CommonParams.AUTOSCALING_HISTORY_PATH,
       AutoscalingHistoryHandler.TRIGGER_PARAM, PREFIX + "_node_added_trigger");
     docs = solrClient.query(query).getResults();
+    if (docs.size() != 8) {
+      zkClient().printLayoutToStdOut();
+      query = params(CommonParams.QT, CommonParams.AUTOSCALING_DIAGNOSTICS_PATH);
+      log.info("Diagnostic output: ", solrClient.query(query).getResponse());
+    }
     assertEquals(8, docs.size());
 
     query = params(CommonParams.QT, CommonParams.AUTOSCALING_HISTORY_PATH,


Mime
View raw message