Skip to content

Change allocation explain message #127060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ public static ShardRouting findShardToExplain(
}
if (foundShard == null) {
throw new IllegalArgumentException(Strings.format("""
No shard was specified in the request which means the response should explain a randomly-chosen unassigned shard, but \
there are no unassigned shards in this cluster. To explain the allocation of an assigned shard you must specify the \
target shard in the request. See %s for more information.""", ReferenceDocs.ALLOCATION_EXPLAIN_API));
There are no unassigned shards in this cluster. Specify an assigned shard in the request body to explain its \
allocation. See %s for more information.""", ReferenceDocs.ALLOCATION_EXPLAIN_API));
}
} else {
if (projectIds.size() != 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ public void testFindAnyUnassignedShardToExplain() {
).getMessage(),
allOf(
// no point in asserting the precise wording of the message into this test, but we care that it contains these bits:
containsString("No shard was specified in the request"),
containsString("specify the target shard in the request"),
containsString("There are no unassigned shards in this cluster."),
containsString("Specify an assigned shard in the request body"),
containsString("https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cluster-allocation-explain")
)
);
Expand Down