You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/12/15 10:04:20 UTC

[28/34] lucene-solr:jira/http2: Indicate collection in `clusterShape` log messages

Indicate collection in `clusterShape` log messages

Many of Solr's tests use CloudTestUtils' `waitForState` and
`clusterShape` methods to wait until a SolrCloud cluster matches a
particular expected shape.  The code periodically checks on the cluster
state, and logs a message if a collection doesn't match the state we
expect of it.  Prior to this commit, these log messages omitted the
collection name though, which makes things a little confusing when a
test is checking on the state of multiple collections simultaneously (as
can happen when Triggers fire in the background).


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

Branch: refs/heads/jira/http2
Commit: dd910d1a06455032a9a18e5f0de3ca45e065ceef
Parents: 3ca7e65
Author: Jason Gerlowski <ge...@apache.org>
Authored: Fri Dec 14 10:57:20 2018 -0500
Committer: Jason Gerlowski <ge...@apache.org>
Committed: Fri Dec 14 12:21:19 2018 -0500

----------------------------------------------------------------------
 solr/core/src/test/org/apache/solr/cloud/CloudTestUtils.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dd910d1a/solr/core/src/test/org/apache/solr/cloud/CloudTestUtils.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/CloudTestUtils.java b/solr/core/src/test/org/apache/solr/cloud/CloudTestUtils.java
index a1fccd2..bb74967 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CloudTestUtils.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CloudTestUtils.java
@@ -141,7 +141,7 @@ public class CloudTestUtils {
       }
       Collection<Slice> slices = withInactive ? collectionState.getSlices() : collectionState.getActiveSlices();
       if (slices.size() != expectedShards) {
-        log.info("-- wrong number of slices, expected={}, found={}: {}", expectedShards, collectionState.getSlices().size(), collectionState.getSlices());
+        log.info("-- wrong number of slices for collection {}, expected={}, found={}: {}", collectionState.getName(), expectedShards, collectionState.getSlices().size(), collectionState.getSlices());
         return false;
       }
       Set<String> leaderless = new HashSet<>();
@@ -160,7 +160,7 @@ public class CloudTestUtils {
             activeReplicas++;
         }
         if (activeReplicas != expectedReplicas) {
-          log.info("-- wrong number of active replicas in slice {}, expected={}, found={}", slice.getName(), expectedReplicas, activeReplicas);
+          log.info("-- wrong number of active replicas for collection {} in slice {}, expected={}, found={}", collectionState.getName(), slice.getName(), expectedReplicas, activeReplicas);
           return false;
         }
       }