You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2018/03/12 17:56:27 UTC
lucene-solr:branch_7x: SOLR-11407: Add more logging to this test to
discover the reason for failures.
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x 00a2f3f38 -> 78d592d2f
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/78d592d2
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/78d592d2
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/78d592d2
Branch: refs/heads/branch_7x
Commit: 78d592d2fdfc64c227fc1bcb8fafa3d806fbb384
Parents: 00a2f3f
Author: Andrzej Bialecki <ab...@apache.org>
Authored: Wed Oct 11 19:26:00 2017 +0200
Committer: Andrzej Bialecki <ab...@apache.org>
Committed: Mon Mar 12 18:56:21 2018 +0100
----------------------------------------------------------------------
.../admin/AutoscalingHistoryHandlerTest.java | 24 ++++++++++++++------
1 file changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78d592d2/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);
}