Skip to content

Commit 001996d

Browse files
committed
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.
1 parent cd9c4d3 commit 001996d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,11 @@ public ClusterTasksResult<StartedShardEntry> execute(ClusterState currentState,
589589

590590
@Override
591591
public void onFailure(String source, Exception e) {
592-
logger.error(() -> new ParameterizedMessage("unexpected failure during [{}]", source), e);
592+
if (e instanceof FailedToCommitClusterStateException || e instanceof NotMasterException) {
593+
logger.debug(() -> new ParameterizedMessage("failure during [{}]", source), e);
594+
} else {
595+
logger.error(() -> new ParameterizedMessage("unexpected failure during [{}]", source), e);
596+
}
593597
}
594598
}
595599

0 commit comments

Comments
 (0)