You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2017/06/23 02:06:44 UTC
lucene-solr:jira/SOLR-10496: SOLR-10496: Remove debugging info from
tests. Enable recursive suggestion of operations.
Repository: lucene-solr
Updated Branches:
refs/heads/jira/SOLR-10496 b023b0119 -> 70f60a23b
SOLR-10496: Remove debugging info from tests. Enable recursive suggestion of operations.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/70f60a23
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/70f60a23
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/70f60a23
Branch: refs/heads/jira/SOLR-10496
Commit: 70f60a23bc1e706abb41a4900c65305f1763f8f6
Parents: b023b01
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Fri Jun 23 07:07:26 2017 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Fri Jun 23 07:07:26 2017 +0530
----------------------------------------------------------------------
.../apache/solr/cloud/autoscaling/ComputePlanAction.java | 9 ++-------
.../solr/cloud/autoscaling/ComputePlanActionTest.java | 6 +++---
2 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/70f60a23/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 253c231..52c7ee7 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
@@ -67,16 +67,13 @@ public class ComputePlanAction implements TriggerAction {
.withHttpClient(container.getUpdateShardHandler().getHttpClient())
.build()) {
ZkStateReader zkStateReader = cloudSolrClient.getZkStateReader();
- zkStateReader.getZkClient().printLayoutToStdOut();
Map<String, Object> autoScalingConf = Utils.getJson(zkStateReader.getZkClient(), ZkStateReader.SOLR_AUTOSCALING_CONF_PATH, true);
if (autoScalingConf.isEmpty()) {
log.error("Action: " + getName() + " executed but no policy is configured");
return;
}
- log.debug("Fetched autoscaling conf: {}", autoScalingConf); // todo nocommit
AutoScalingConfig config = new AutoScalingConfig(autoScalingConf);
Policy policy = config.getPolicy();
- log.debug("created policy"); // todo nocommit
Policy.Session session = policy.createSession(new SolrClientDataProvider(cloudSolrClient));
Policy.Suggester suggester = getSuggester(session, event);
while (true) {
@@ -90,10 +87,8 @@ public class ComputePlanAction implements TriggerAction {
operations.add(operation);
return operations;
});
- // todo nocommit following code is temporarily disabled until iterative calling of suggester is supported
-// session = suggester.getSession();
-// suggester = getSuggester(session, event);
- break;
+ session = suggester.getSession();
+ suggester = getSuggester(session, event);
}
}
} catch (KeeperException e) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/70f60a23/solr/core/src/test/org/apache/solr/cloud/autoscaling/ComputePlanActionTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/ComputePlanActionTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/ComputePlanActionTest.java
index 5faf82b..1ca5d4a 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/ComputePlanActionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/ComputePlanActionTest.java
@@ -130,14 +130,14 @@ public class ComputePlanActionTest extends SolrCloudTestCase {
waitForState("Timed out waiting for replicas of new collection to be active",
"testNodeLost", (liveNodes, collectionState) -> collectionState.getReplicas().stream().allMatch(replica -> replica.isActive(liveNodes)));
- zkClient().printLayoutToStdOut(); // todo nocommit
-
ClusterState clusterState = cluster.getSolrClient().getZkStateReader().getClusterState();
DocCollection collection = clusterState.getCollection("testNodeLost");
List<Replica> replicas = collection.getReplicas(node);
assertNotNull(replicas);
assertFalse(replicas.isEmpty());
+ // start another node because because when the other node goes away, the cluster policy requires only
+ // 1 replica per node and none on the overseer
cluster.startJettySolrRunner();
cluster.waitForAllNodes(30);
@@ -150,7 +150,7 @@ public class ComputePlanActionTest extends SolrCloudTestCase {
}
cluster.waitForAllNodes(30);
- assertTrue("Trigger was not fired even after 5 seconds", triggerFiredLatch.await(180, TimeUnit.SECONDS));
+ assertTrue("Trigger was not fired even after 5 seconds", triggerFiredLatch.await(5, TimeUnit.SECONDS));
assertTrue(fired.get());
Map context = (Map) eventContextRef.get();
assertNotNull(context);