From fe39d11c55c5fea0518bf0c38c87cd15343416e7 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Fri, 15 Jan 2016 09:45:39 -0500 Subject: [PATCH] Logging in shard state action This commit adds a trace log on a cluster state update while waiting for a new master, and changes the log level on cluster service close to the warn level. --- .../elasticsearch/cluster/action/shard/ShardStateAction.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java b/core/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java index b2b264c81f9..e76425a1188 100644 --- a/core/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java +++ b/core/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java @@ -137,12 +137,15 @@ public class ShardStateAction extends AbstractComponent { observer.waitForNextChange(new ClusterStateObserver.Listener() { @Override public void onNewClusterState(ClusterState state) { + if (logger.isTraceEnabled()) { + logger.trace("new cluster state [{}] after waiting for master election to fail shard [{}]", shardRoutingEntry.getShardRouting().shardId(), state.prettyPrint(), shardRoutingEntry); + } sendShardFailed(observer, shardRoutingEntry, listener); } @Override public void onClusterServiceClose() { - logger.error("{} node closed while handling failed shard [{}]", shardRoutingEntry.failure, shardRoutingEntry.getShardRouting().getId(), shardRoutingEntry.getShardRouting()); + logger.warn("{} node closed while handling failed shard [{}]", shardRoutingEntry.failure, shardRoutingEntry.getShardRouting().getId(), shardRoutingEntry.getShardRouting()); listener.onShardFailedFailure(new NodeClosedException(clusterService.localNode())); }