From a76c034866f80f430f8370371fd24b2f4b27d446 Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Thu, 20 Jun 2019 13:22:42 +0200 Subject: [PATCH] Reduce shard started failure logging (#43330) If the master is stepping or shutting down, the error-level logging can cause quite a bit of noise. --- .../cluster/action/shard/ShardStateAction.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java b/server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java index c9f40ba6728..b07ba8d09f3 100644 --- a/server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java +++ b/server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java @@ -589,7 +589,11 @@ public class ShardStateAction { @Override public void onFailure(String source, Exception e) { - logger.error(() -> new ParameterizedMessage("unexpected failure during [{}]", source), e); + if (e instanceof FailedToCommitClusterStateException || e instanceof NotMasterException) { + logger.debug(() -> new ParameterizedMessage("failure during [{}]", source), e); + } else { + logger.error(() -> new ParameterizedMessage("unexpected failure during [{}]", source), e); + } } }