You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/06/22 02:58:31 UTC

[GitHub] [lucene-solr] noblepaul opened a new pull request #1598: SOLR-14409: Existing violations allow bypassing policy rules when add…

noblepaul opened a new pull request #1598:
URL: https://github.com/apache/lucene-solr/pull/1598


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] noblepaul commented on a change in pull request #1598: SOLR-14409: Existing violations allow bypassing policy rules when add…

Posted by GitBox <gi...@apache.org>.
noblepaul commented on a change in pull request #1598:
URL: https://github.com/apache/lucene-solr/pull/1598#discussion_r444575124



##########
File path: solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy2.java
##########
@@ -516,6 +517,16 @@ public void testInfiniteLoop() {
     System.out.println(suggestions);
   }
 
+  public void testAddTooManyPerPolicy() {
+    Map<String, Object> m = (Map<String, Object>) loadFromResource("testAddTooManyPerPolicy.json");
+    SolrCloudManager cloudManagerFromDiagnostics = createCloudManagerFromDiagnostics(m);
+    AutoScalingConfig autoScalingConfig = new AutoScalingConfig((Map<String, Object>) getObjectByPath(m, false, "diagnostics/config"));
+    SolrException exp =  expectThrows(SolrException.class, () -> PolicyHelper.getReplicaLocations("TooManyPerPolicy", autoScalingConfig, cloudManagerFromDiagnostics,
+            EMPTY_MAP, Collections.singletonList("shard1"), 1, 0, 0, null));
+    assertTrue(exp.getMessage().contains("No node can satisfy the rules"));

Review comment:
       what's the difference?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] noblepaul merged pull request #1598: SOLR-14409: Existing violations allow bypassing policy rules when add…

Posted by GitBox <gi...@apache.org>.
noblepaul merged pull request #1598:
URL: https://github.com/apache/lucene-solr/pull/1598


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] noblepaul commented on pull request #1598: SOLR-14409: Existing violations allow bypassing policy rules when add…

Posted by GitBox <gi...@apache.org>.
noblepaul commented on pull request #1598:
URL: https://github.com/apache/lucene-solr/pull/1598#issuecomment-647991595


   @sigram 
   shall I go ahead and merge this?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] madrob commented on a change in pull request #1598: SOLR-14409: Existing violations allow bypassing policy rules when add…

Posted by GitBox <gi...@apache.org>.
madrob commented on a change in pull request #1598:
URL: https://github.com/apache/lucene-solr/pull/1598#discussion_r445653717



##########
File path: solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy2.java
##########
@@ -516,6 +517,16 @@ public void testInfiniteLoop() {
     System.out.println(suggestions);
   }
 
+  public void testAddTooManyPerPolicy() {
+    Map<String, Object> m = (Map<String, Object>) loadFromResource("testAddTooManyPerPolicy.json");
+    SolrCloudManager cloudManagerFromDiagnostics = createCloudManagerFromDiagnostics(m);
+    AutoScalingConfig autoScalingConfig = new AutoScalingConfig((Map<String, Object>) getObjectByPath(m, false, "diagnostics/config"));
+    SolrException exp =  expectThrows(SolrException.class, () -> PolicyHelper.getReplicaLocations("TooManyPerPolicy", autoScalingConfig, cloudManagerFromDiagnostics,
+            EMPTY_MAP, Collections.singletonList("shard1"), 1, 0, 0, null));
+    assertTrue(exp.getMessage().contains("No node can satisfy the rules"));

Review comment:
       You get a better error message when the test fails.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] madrob commented on a change in pull request #1598: SOLR-14409: Existing violations allow bypassing policy rules when add…

Posted by GitBox <gi...@apache.org>.
madrob commented on a change in pull request #1598:
URL: https://github.com/apache/lucene-solr/pull/1598#discussion_r444323329



##########
File path: solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy2.java
##########
@@ -516,6 +517,16 @@ public void testInfiniteLoop() {
     System.out.println(suggestions);
   }
 
+  public void testAddTooManyPerPolicy() {
+    Map<String, Object> m = (Map<String, Object>) loadFromResource("testAddTooManyPerPolicy.json");
+    SolrCloudManager cloudManagerFromDiagnostics = createCloudManagerFromDiagnostics(m);
+    AutoScalingConfig autoScalingConfig = new AutoScalingConfig((Map<String, Object>) getObjectByPath(m, false, "diagnostics/config"));
+    SolrException exp =  expectThrows(SolrException.class, () -> PolicyHelper.getReplicaLocations("TooManyPerPolicy", autoScalingConfig, cloudManagerFromDiagnostics,
+            EMPTY_MAP, Collections.singletonList("shard1"), 1, 0, 0, null));
+    assertTrue(exp.getMessage().contains("No node can satisfy the rules"));

Review comment:
       `assertThat(exp.getMessage(), contains("..."))`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] sigram commented on pull request #1598: SOLR-14409: Existing violations allow bypassing policy rules when add…

Posted by GitBox <gi...@apache.org>.
sigram commented on pull request #1598:
URL: https://github.com/apache/lucene-solr/pull/1598#issuecomment-648800310


   This change fixes the original issue, so it's +1 on the change.
   
   However, please note that the tests contain many unchecked casts and these need to be fixed before committing, otherwise gradle build will fail.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org