Skip to content
Closed
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
16 changes: 8 additions & 8 deletions docs/reference/cluster/allocation-explain.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ GET /_cluster/allocation/explain

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should address the needed changes @DaveCTurner mentioned. This snippet (or something like it) is required to pass the CI tests.

Suggested change
//////
[source,console]
--------------------------------------------------
DELETE /myindex
--------------------------------------------------
//////

[source,console]
--------------------------------------------------
PUT /idx?master_timeout=1s&timeout=1s
PUT /myindex?master_timeout=1s&timeout=1s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I remember why I did not use myindex in the first place. myindex is created previously in this documentation, however, it successfully allocates, which means that the explain API has nothing to explain. I create the idx index with the non_existent_node allocation filtering so that I can guarantee that the index is not successfully allocated for the documentation tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in fact, the right PR I should do is rename everything from myindex to idx ? 😀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for this you can update the settings on the myindex index here instead of trying to recreate it.

{"settings": {"index.routing.allocation.include._name": "non_existent_node"} }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github won't let me comment above this line, but two lines above this there is:

PUT /idx?master_timeout=1s&timeout=1s
{"settings": {"index.routing.allocation.include._name": "non_existent_node"} }

That would need to be changed to use myindex instead of idx also for this PR

GET /_cluster/allocation/explain
{
"index": "idx",
"index": "myindex",
"shard": 0,
"primary": true
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to add: You'll also need to include a // TEST[continued] comment at the end of this snippet.

Expand All @@ -122,7 +122,7 @@ The API returns the following response for an unassigned primary shard:
[source,console-result]
--------------------------------------------------
{
"index" : "idx",
"index" : "myindex",
"shard" : 0,
"primary" : true,
"current_state" : "unassigned", <1>
Expand Down Expand Up @@ -171,7 +171,7 @@ allocated to a node in the cluster:
[source,js]
--------------------------------------------------
{
"index" : "idx",
"index" : "myindex",
"shard" : 0,
"primary" : true,
"current_state" : "unassigned",
Expand All @@ -196,7 +196,7 @@ allocation:
[source,js]
--------------------------------------------------
{
"index" : "idx",
"index" : "myindex",
"shard" : 0,
"primary" : false,
"current_state" : "unassigned",
Expand Down Expand Up @@ -232,7 +232,7 @@ allocation:
{
"decider" : "same_shard",
"decision" : "NO",
"explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[idx][0], node[3sULLVJrRneSg0EfBB-2Ew], [P], s[STARTED], a[id=eV9P8BN1QPqRc3B4PLx6cg]]"
"explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[myindex][0], node[3sULLVJrRneSg0EfBB-2Ew], [P], s[STARTED], a[id=eV9P8BN1QPqRc3B4PLx6cg]]"
}
]
}
Expand All @@ -253,7 +253,7 @@ its current node and is required to move:
[source,js]
--------------------------------------------------
{
"index" : "idx",
"index" : "myindex",
"shard" : 0,
"primary" : true,
"current_state" : "started",
Expand Down Expand Up @@ -302,7 +302,7 @@ because moving the shard to another node does not form a better cluster balance:
[source,js]
--------------------------------------------------
{
"index" : "idx",
"index" : "myindex",
"shard" : 0,
"primary" : true,
"current_state" : "started",
Expand Down