The ILM shrink action seems to be unreliable when trying to allocate primary shards to the same node because it stuck at this step check-shrink-allocation
step with the message: Waiting for node [XYZ] to contain [3] shards, found [2], remaining [1]
.
Also, according to [the docs], it is supposed to allocated primary shards. (Shrink | Elasticsearch Guide [8.11] | Elastic):
The shrink action allocates all primary shards of the index to one node so it can call the Shrink API to shrink the index. After shrinking, it swaps aliases that point to the original index to the new shrunken index.
However, when I checked my node XYZ, the 2 shards that have been allocated to node XYZ are actually replica shards! So it is either the docs are not correct or ILM shrink action is not considering the right shards.
I cannot retry the ILM action either because the index has not encountered an error when running a Lifecycle Policy
.
What is recommended to be done in this case? Should I manually reroute to allocate a shard to node XYZ?