浏览代码

Logging: shard store shouldn't log the entire cluster state under trace, but just its version.

If we want the entire CS, we can put the cluster.service on trace
Boaz Leskes 10 年之前
父节点
当前提交
29c99ff23d

+ 1 - 1
core/src/main/java/org/elasticsearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java

@@ -83,7 +83,7 @@ public class TransportIndicesShardStoresAction extends TransportMasterNodeReadAc
         final String[] concreteIndices = indexNameExpressionResolver.concreteIndices(state, request);
         final String[] concreteIndices = indexNameExpressionResolver.concreteIndices(state, request);
         final Set<ShardId> shardIdsToFetch = new HashSet<>();
         final Set<ShardId> shardIdsToFetch = new HashSet<>();
 
 
-        logger.trace("cluster state used to determine shards [{}]", state.prettyPrint());
+        logger.trace("using cluster state version [{}] to determine shards", state.version());
         // collect relevant shard ids of the requested indices for fetching store infos
         // collect relevant shard ids of the requested indices for fetching store infos
         for (String index : concreteIndices) {
         for (String index : concreteIndices) {
             IndexRoutingTable indexShardRoutingTables = routingTables.index(index);
             IndexRoutingTable indexShardRoutingTables = routingTables.index(index);

+ 1 - 1
core/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesShardStoreRequestTests.java

@@ -58,7 +58,7 @@ public class IndicesShardStoreRequestTests extends ElasticsearchIntegrationTest
     }
     }
 
 
     @Test
     @Test
-    @TestLogging("action.admin.indices.shards:TRACE")
+    @TestLogging("action.admin.indices.shards:TRACE,cluster.service:TRACE")
     public void testBasic() throws Exception {
     public void testBasic() throws Exception {
         String index = "test";
         String index = "test";
         internalCluster().ensureAtLeastNumDataNodes(2);
         internalCluster().ensureAtLeastNumDataNodes(2);