From 0c44459f6aa14256f5d2b1ad0385e0f0f8ae9c5d Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 30 Jan 2024 13:07:50 +0000 Subject: [PATCH] Improve `CANNOT_REBALANCE_CAN_ALLOCATE` explanation (#104904) (#104910) Clarify that in this situation there is a rebalancing move that would improve the cluster balance, but there's some reason why rebalancing is not happening. Also points at the `can_rebalance_cluster_decisions` as well as the node-by-node decisions since the action needed could be described in either place. --- docs/changelog/104904.yaml | 5 +++++ .../cluster/routing/allocation/Explanations.java | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 docs/changelog/104904.yaml diff --git a/docs/changelog/104904.yaml b/docs/changelog/104904.yaml new file mode 100644 index 0000000000000..07e22feb144ed --- /dev/null +++ b/docs/changelog/104904.yaml @@ -0,0 +1,5 @@ +pr: 104904 +summary: Improve `CANNOT_REBALANCE_CAN_ALLOCATE` explanation +area: Allocation +type: bug +issues: [] diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/Explanations.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/Explanations.java index 4549858c2508b..569335cc65a5d 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/Explanations.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/Explanations.java @@ -79,9 +79,11 @@ public static final class Rebalance { activities. The shard will be rebalanced when those activities finish. Please wait."""; public static final String CANNOT_REBALANCE_CAN_ALLOCATE = """ - Elasticsearch is allowed to allocate this shard to another node but it isn't allowed to rebalance the shard there. If you \ - expect this shard to be rebalanced to another node, find this node in the node-by-node explanation and address the reasons \ - which prevent Elasticsearch from rebalancing this shard there."""; + Elasticsearch is allowed to allocate this shard on another node, and there is at least one node to which it could move this \ + shard that would improve the overall cluster balance, but it isn't allowed to rebalance this shard there. If you expect this \ + shard to be rebalanced to another node, check the cluster-wide rebalancing decisions and address any reasons preventing \ + Elasticsearch from rebalancing shards within the cluster, and then find the expected node in the node-by-node explanation and \ + address the reasons which prevent Elasticsearch from moving this shard there."""; public static final String CANNOT_REBALANCE_CANNOT_ALLOCATE = """ Elasticsearch is not allowed to allocate or rebalance this shard to another node. If you expect this shard to be rebalanced to \