You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2017/07/05 06:03:45 UTC

[1/2] lucene-solr:feature/autoscaling: SOLR-10994: fixing test errors

Repository: lucene-solr
Updated Branches:
  refs/heads/feature/autoscaling dfb752254 -> 1c8589c6e


SOLR-10994: fixing test errors


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

Branch: refs/heads/feature/autoscaling
Commit: 43feb76df93c43a2d8cabed498d62705a51e9556
Parents: 467c692
Author: Noble Paul <no...@apache.org>
Authored: Wed Jul 5 15:33:20 2017 +0930
Committer: Noble Paul <no...@apache.org>
Committed: Wed Jul 5 15:33:20 2017 +0930

----------------------------------------------------------------------
 .../autoscaling/AutoScalingHandlerTest.java     | 22 ++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43feb76d/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
index 06c2920..e4f8f52 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
@@ -595,6 +595,9 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
         "    ]," +
         "    'policy1':[" +
         "      {'replica':'<2', 'shard': '#EACH', 'node': '#ANY'}" +
+        "    ]," +
+        "    'policy2':[" +
+        "      {'replica':'<7', 'shard': '#EACH', 'node': '#ANY'}" +
         "    ]" +
         "}}";
     req = createAutoScalingRequest(SolrRequest.METHOD.POST, setPolicyCommand);
@@ -624,7 +627,7 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
 
     Map policies = (Map) response.get("policies");
     assertNotNull(policies);
-    assertEquals(2, policies.size());
+    assertEquals(3, policies.size());
     assertNotNull(policies.get("xyz"));
     assertNotNull(policies.get("policy1"));
 
@@ -660,10 +663,21 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
     assertEquals(0, violations.size());
 
     // lets create a collection which violates the rule replicas < 2
-    CollectionAdminRequest.Create create = CollectionAdminRequest.Create.createCollection("readApiTestViolations", CONFIGSET_NAME, 1, 6);
-    create.setMaxShardsPerNode(10);
-    CollectionAdminResponse adminResponse = create.process(solrClient);
+    CollectionAdminResponse adminResponse = CollectionAdminRequest.Create
+        .createCollection("readApiTestViolations", CONFIGSET_NAME, 1, 6)
+        .setPolicy("policy2")
+        .setMaxShardsPerNode(10)
+        .process(solrClient);
     assertTrue(adminResponse.isSuccess());
+    setPolicyCommand =  "{'set-policy': {" +
+        "    'policy2':[" +
+        "      {'replica':'<2', 'shard': '#EACH', 'node': '#ANY'}" +
+        "    ]" +
+        "}}";
+
+    req = createAutoScalingRequest(SolrRequest.METHOD.POST, setPolicyCommand);
+    response = solrClient.request(req);
+    assertEquals(response.get("result").toString(), "success");
 
     // get the diagnostics output again
     req = createAutoScalingRequest(SolrRequest.METHOD.GET, "/diagnostics", null);


[2/2] lucene-solr:feature/autoscaling: Merge remote-tracking branch 'origin/feature/autoscaling' into feature/autoscaling

Posted by no...@apache.org.
Merge remote-tracking branch 'origin/feature/autoscaling' into feature/autoscaling


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

Branch: refs/heads/feature/autoscaling
Commit: 1c8589c6eac5aa215ca09c2a26c6eb848edf096d
Parents: 43feb76 dfb7522
Author: Noble Paul <no...@apache.org>
Authored: Wed Jul 5 15:33:37 2017 +0930
Committer: Noble Paul <no...@apache.org>
Committed: Wed Jul 5 15:33:37 2017 +0930

----------------------------------------------------------------------
 .../autoscaling/AutoScalingHandlerTest.java     | 24 ++++++++++
 .../autoscaling/ComputePlanActionTest.java      | 41 ++++++++++++----
 .../autoscaling/TriggerIntegrationTest.java     | 50 +++++++++-----------
 3 files changed, 78 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1c8589c6/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
----------------------------------------------------------------------
diff --cc solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
index e4f8f52,1cfe5cd..f2fc2d3
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
@@@ -662,23 -659,36 +662,47 @@@ public class AutoScalingHandlerTest ext
      assertNotNull(violations);
      assertEquals(0, violations.size());
  
+     // temporarily increase replica limit in cluster policy so that we can create a collection with 6 replicas
+     setClusterPolicyCommand = "{" +
+         " 'set-cluster-policy': [" +
+         "      {'cores':'<10', 'node':'#ANY'}," +
+         "      {'replica':'<4', 'shard': '#EACH', 'node': '#ANY'}," +
+         "      {'nodeRole':'overseer', 'replica':0}" +
+         "    ]" +
+         "}";
+     req = createAutoScalingRequest(SolrRequest.METHOD.POST, setClusterPolicyCommand);
+     response = solrClient.request(req);
+     assertEquals(response.get("result").toString(), "success");
+ 
      // lets create a collection which violates the rule replicas < 2
 -    CollectionAdminRequest.Create create = CollectionAdminRequest.Create.createCollection("readApiTestViolations", CONFIGSET_NAME, 1, 6);
 -    create.setMaxShardsPerNode(10);
 -    CollectionAdminResponse adminResponse = create.process(solrClient);
 +    CollectionAdminResponse adminResponse = CollectionAdminRequest.Create
 +        .createCollection("readApiTestViolations", CONFIGSET_NAME, 1, 6)
 +        .setPolicy("policy2")
 +        .setMaxShardsPerNode(10)
 +        .process(solrClient);
      assertTrue(adminResponse.isSuccess());
 +    setPolicyCommand =  "{'set-policy': {" +
 +        "    'policy2':[" +
 +        "      {'replica':'<2', 'shard': '#EACH', 'node': '#ANY'}" +
 +        "    ]" +
 +        "}}";
 +
 +    req = createAutoScalingRequest(SolrRequest.METHOD.POST, setPolicyCommand);
 +    response = solrClient.request(req);
 +    assertEquals(response.get("result").toString(), "success");
  
+     // reset to original cluster policy which allows only 1 replica per shard per node
+     setClusterPolicyCommand = "{" +
+         " 'set-cluster-policy': [" +
+         "      {'cores':'<10', 'node':'#ANY'}," +
+         "      {'replica':'<2', 'shard': '#EACH', 'node': '#ANY'}," +
+         "      {'nodeRole':'overseer', 'replica':0}" +
+         "    ]" +
+         "}";
+     req = createAutoScalingRequest(SolrRequest.METHOD.POST, setClusterPolicyCommand);
+     response = solrClient.request(req);
+     assertEquals(response.get("result").toString(), "success");
+ 
      // get the diagnostics output again
      req = createAutoScalingRequest(SolrRequest.METHOD.GET, "/diagnostics", null);
      response = solrClient.request(req);