Skip to content

Commit 0824b59

Browse files
improve explanation messages: limit decimal points and improve wording
1 parent b896291 commit 0824b59

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/WriteLoadConstraintDecider.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing
6565
if (nodeWriteThreadPoolStats.averageThreadPoolUtilization() >= nodeWriteThreadPoolLoadThreshold) {
6666
// The node's write thread pool usage stats already show high utilization above the threshold for accepting new shards.
6767
String explain = Strings.format(
68-
"Node [%s] with write thread pool utilization [%f] already exceeds the high utilization threshold of [%f]. Cannot allocate "
69-
+ "shard [%s] to node without risking increased write latencies.",
68+
"Node [%s] with write thread pool utilization [%.2f] already exceeds the high utilization threshold of [%f]. Cannot "
69+
+ "allocate shard [%s] to node without risking increased write latencies.",
7070
node.nodeId(),
7171
nodeWriteThreadPoolStats.averageThreadPoolUtilization(),
7272
nodeWriteThreadPoolLoadThreshold,
@@ -80,9 +80,9 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing
8080
// The node's write thread pool usage would be raised above the high utilization threshold with assignment of the new shard.
8181
// This could lead to a hot spot on this node and is undesirable.
8282
String explain = Strings.format(
83-
"The high utilization threshold of [%f] would be exceeded on node [%s] with utilization [%f] if shard [%s] with estimated "
84-
+ "write load [%f] (execution time [%f] / threads [%d]) were assigned to it. Cannot allocate shard to node without "
85-
+ "risking increased write latencies.",
83+
"The high utilization threshold of [%f] would be exceeded on node [%s] with utilization [%.2f] if shard [%s] with "
84+
+ "estimated additional utilisation [%.5f] (write load [%.5f] / threads [%d]) were assigned to it. Cannot allocate "
85+
+ "shard to node without risking increased write latencies.",
8686
nodeWriteThreadPoolLoadThreshold,
8787
node.nodeId(),
8888
nodeWriteThreadPoolStats.averageThreadPoolUtilization(),

0 commit comments

Comments
 (0)