Skip to content

Commit 4f48040

Browse files
[DOCS] Add response examples to cluster allocation explain API (#3961) (#3989)
(cherry picked from commit 8616217) Co-authored-by: Lisa Cawley <[email protected]>
1 parent 76c7c1d commit 4f48040

File tree

4 files changed

+104
-0
lines changed

4 files changed

+104
-0
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
summary: Conflicting settings
2+
description: >
3+
An example of an allocation explanation for an unassigned primary shard.
4+
In this example, a newly created index has an index setting that requires that it only be allocated to a node named `nonexistent_node`, which does not exist, so the index is unable to allocate.
5+
# type: response
6+
# response_code:
7+
value: |-
8+
{
9+
"index" : "my-index-000001",
10+
"shard" : 0,
11+
"primary" : true,
12+
"current_state" : "unassigned",
13+
"unassigned_info" : {
14+
"reason" : "INDEX_CREATED",
15+
"at" : "2017-01-04T18:08:16.600Z",
16+
"last_allocation_status" : "no"
17+
},
18+
"can_allocate" : "no",
19+
"allocate_explanation" : "Elasticsearch isn't allowed to allocate this shard to any of the nodes in the cluster. Choose a node to which you expect this shard to be allocated, find this node in the node-by-node explanation, and address the reasons which prevent Elasticsearch from allocating this shard there.",
20+
"node_allocation_decisions" : [
21+
{
22+
"node_id" : "8qt2rY-pT6KNZB3-hGfLnw",
23+
"node_name" : "node-0",
24+
"transport_address" : "127.0.0.1:9401",
25+
"roles" : ["data", "data_cold", "data_content", "data_frozen", "data_hot", "data_warm", "ingest", "master", "ml", "remote_cluster_client", "transform"],
26+
"node_attributes" : {},
27+
"node_decision" : "no",
28+
"weight_ranking" : 1,
29+
"deciders" : [
30+
{
31+
"decider" : "filter",
32+
"decision" : "NO",
33+
"explanation" : "node does not match index setting [index.routing.allocation.include] filters [_name:\"nonexistent_node\"]"
34+
}
35+
]
36+
}
37+
]
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
summary: Maximum retries
2+
description: >
3+
An example of an allocation explanation for an unassigned primary shard that has reached the maximum number of allocation retry attempts.
4+
After the maximum number of retries is reached, Elasticsearch stops attempting to allocate the shard in order to prevent infinite retries which may impact cluster performance.
5+
# type: response
6+
# response_code:
7+
value: |-
8+
{
9+
"index" : "my-index-000001",
10+
"shard" : 0,
11+
"primary" : true,
12+
"current_state" : "unassigned",
13+
"unassigned_info" : {
14+
"at" : "2017-01-04T18:03:28.464Z",
15+
"failed shard on node [mEKjwwzLT1yJVb8UxT6anw]: failed recovery, failure RecoveryFailedException",
16+
"reason": "ALLOCATION_FAILED",
17+
"failed_allocation_attempts": 5,
18+
"last_allocation_status": "no",
19+
},
20+
"can_allocate": "no",
21+
"allocate_explanation": "cannot allocate because allocation is not permitted to any of the nodes",
22+
"node_allocation_decisions" : [
23+
{
24+
"node_id" : "3sULLVJrRneSg0EfBB-2Ew",
25+
"node_name" : "node_t0",
26+
"transport_address" : "127.0.0.1:9400",
27+
"roles" : ["data_content", "data_hot"],
28+
"node_decision" : "no",
29+
"store" : {
30+
"matching_size" : "4.2kb",
31+
"matching_size_in_bytes" : 4325
32+
},
33+
"deciders" : [
34+
{
35+
"decider": "max_retry",
36+
"decision" : "NO",
37+
"explanation": "shard has exceeded the maximum number of retries [5] on failed allocation attempts - manually call [POST /_cluster/reroute?retry_failed] to retry, [unassigned_info[[reason=ALLOCATION_FAILED], at[2024-07-30T21:04:12.166Z], failed_attempts[5], failed_nodes[[mEKjwwzLT1yJVb8UxT6anw]], delayed=false, details[failed shard on node [mEKjwwzLT1yJVb8UxT6anw]: failed recovery, failure RecoveryFailedException], allocation_status[deciders_no]]]"
38+
}
39+
]
40+
}
41+
]
42+
}

0 commit comments

Comments
 (0)