You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2018/03/20 09:25:24 UTC

lucene-solr:branch_7_3: SOLR-11407: Add more logging to this test to discover the reason for failures.

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7_3 0977743ae -> 40c49ec3a


SOLR-11407: Add more logging to this test to discover the reason for failures.


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

Branch: refs/heads/branch_7_3
Commit: 40c49ec3a1936367197b3a6046a187e01252e3c1
Parents: 0977743
Author: Andrzej Bialecki <ab...@apache.org>
Authored: Wed Oct 11 19:26:00 2017 +0200
Committer: Alan Woodward <ro...@apache.org>
Committed: Tue Mar 20 09:21:06 2018 +0000

----------------------------------------------------------------------
 .../admin/AutoscalingHistoryHandlerTest.java    | 24 ++++++++++++++------
 1 file changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/40c49ec3/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 23fe619..1133684 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
@@ -249,8 +249,10 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
     waitForState("Timed out wait for collection be active", CollectionAdminParams.SYSTEM_COLL,
         clusterShape(1, 1));
 
+    log.info("### Start add node...");
     JettySolrRunner jetty = cluster.startJettySolrRunner();
     String nodeAddedName = jetty.getNodeName();
+    log.info("### Added node " + nodeAddedName);
     boolean await = actionFiredLatch.await(60, TimeUnit.SECONDS);
     assertTrue("action did not execute", await);
 
@@ -342,6 +344,7 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
 
     Thread.sleep(5000);
     // commit on the history collection
+    log.info("### Commit .system");
     solrClient.commit(CollectionAdminParams.SYSTEM_COLL);
     Thread.sleep(5000);
 
@@ -372,18 +375,25 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
   private static void waitForRecovery(String collection) throws Exception {
     log.info("Waiting for recovery of " + collection);
     boolean recovered = false;
+    boolean allActive = true;
+    boolean hasLeaders = true;
+    DocCollection collState = null;
     for (int i = 0; i < 300; i++) {
       ClusterState state = solrClient.getZkStateReader().getClusterState();
-      DocCollection collState = getCollectionState(collection);
+      collState = getCollectionState(collection);
       log.debug("###### " + collState);
       Collection<Replica> replicas = collState.getReplicas();
-      boolean allActive = true;
-      boolean hasLeaders = true;
+      allActive = true;
+      hasLeaders = true;
       if (replicas != null && !replicas.isEmpty()) {
         for (Replica r : replicas) {
-          if (!r.isActive(state.getLiveNodes())) {
-            log.info("Not active: " + r);
-            allActive = false;
+          if (state.getLiveNodes().contains(r.getNodeName())) {
+            if (!r.isActive(state.getLiveNodes())) {
+              log.info("Not active: " + r);
+              allActive = false;
+            }
+          } else {
+            log.info("Replica no longer on a live node, ignoring: " + r);
           }
         }
       } else {
@@ -402,7 +412,7 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
         Thread.sleep(1000);
       }
     }
-    assertTrue("replica never fully recovered", recovered);
+    assertTrue("replica never fully recovered: allActive=" + allActive + ", hasLeaders=" + hasLeaders + ", collState=" + collState, recovered);
 
   }
 


Re: lucene-solr:branch_7_3: SOLR-11407: Add more logging to this test to discover the reason for failures.

Posted by Andrzej BiaƂecki <an...@lucidworks.com>.
Thank you!

> On 20 Mar 2018, at 10:25, romseygeek@apache.org wrote:
> 
> Repository: lucene-solr
> Updated Branches:
>  refs/heads/branch_7_3 0977743ae -> 40c49ec3a
> 
> 
> SOLR-11407: Add more logging to this test to discover the reason for failures.
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
> Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/40c49ec3
> Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/40c49ec3
> Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/40c49ec3
> 
> Branch: refs/heads/branch_7_3
> Commit: 40c49ec3a1936367197b3a6046a187e01252e3c1
> Parents: 0977743
> Author: Andrzej Bialecki <ab...@apache.org>
> Authored: Wed Oct 11 19:26:00 2017 +0200
> Committer: Alan Woodward <ro...@apache.org>
> Committed: Tue Mar 20 09:21:06 2018 +0000
> 
> ----------------------------------------------------------------------
> .../admin/AutoscalingHistoryHandlerTest.java    | 24 ++++++++++++++------
> 1 file changed, 17 insertions(+), 7 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/40c49ec3/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 23fe619..1133684 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
> @@ -249,8 +249,10 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
>     waitForState("Timed out wait for collection be active", CollectionAdminParams.SYSTEM_COLL,
>         clusterShape(1, 1));
> 
> +    log.info("### Start add node...");
>     JettySolrRunner jetty = cluster.startJettySolrRunner();
>     String nodeAddedName = jetty.getNodeName();
> +    log.info("### Added node " + nodeAddedName);
>     boolean await = actionFiredLatch.await(60, TimeUnit.SECONDS);
>     assertTrue("action did not execute", await);
> 
> @@ -342,6 +344,7 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
> 
>     Thread.sleep(5000);
>     // commit on the history collection
> +    log.info("### Commit .system");
>     solrClient.commit(CollectionAdminParams.SYSTEM_COLL);
>     Thread.sleep(5000);
> 
> @@ -372,18 +375,25 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
>   private static void waitForRecovery(String collection) throws Exception {
>     log.info("Waiting for recovery of " + collection);
>     boolean recovered = false;
> +    boolean allActive = true;
> +    boolean hasLeaders = true;
> +    DocCollection collState = null;
>     for (int i = 0; i < 300; i++) {
>       ClusterState state = solrClient.getZkStateReader().getClusterState();
> -      DocCollection collState = getCollectionState(collection);
> +      collState = getCollectionState(collection);
>       log.debug("###### " + collState);
>       Collection<Replica> replicas = collState.getReplicas();
> -      boolean allActive = true;
> -      boolean hasLeaders = true;
> +      allActive = true;
> +      hasLeaders = true;
>       if (replicas != null && !replicas.isEmpty()) {
>         for (Replica r : replicas) {
> -          if (!r.isActive(state.getLiveNodes())) {
> -            log.info("Not active: " + r);
> -            allActive = false;
> +          if (state.getLiveNodes().contains(r.getNodeName())) {
> +            if (!r.isActive(state.getLiveNodes())) {
> +              log.info("Not active: " + r);
> +              allActive = false;
> +            }
> +          } else {
> +            log.info("Replica no longer on a live node, ignoring: " + r);
>           }
>         }
>       } else {
> @@ -402,7 +412,7 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
>         Thread.sleep(1000);
>       }
>     }
> -    assertTrue("replica never fully recovered", recovered);
> +    assertTrue("replica never fully recovered: allActive=" + allActive + ", hasLeaders=" + hasLeaders + ", collState=" + collState, recovered);
> 
>   }
> 
>