-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
ES doesn't exhaust options for allocation leaving unassigned shards. #12273
Comments
@johntdyer you can see why the shard won't allocate to the node in the output of the reroute command, specifically this line:
This comes from the In the future however, issues like this should be opened on the discussion forums instead of as issues here. |
Lee,
John Sent from my iPhone
|
It looks like each of your nodes already has the maximum 2 shards for this index (the setting from above). This shard happened to be last and thus won't be allocated. You need to increase the total_shards_per_node setting, or add another node. |
@dakrone - I am sorry for my naivety on this but I am still confused.... I can see under
|
The It's a hard limit in a process which, for the most part, relies on heuristics and, as such, is a bit of a hack. I'd prefer to remove the setting and instead solve the problem by trying harder to spread out shards from the same index. See #12279 for more on this. |
That is a dangerous one to remove. It's one of the most important parts of
|
@nik9000 i'm only proposing removing it if we support a better option that doesn't suffer from the same issues. |
@clintongormley I was able to repro this using an index (configured to require box_type="hot") with a single shard and a cluster with a single valid node (with box_type="hot"). I used index.routing.allocation.require.total_shards_per_node=1... The shard was basically stuck in the UNASSIGNED state indefinitely and the index was red. (version 5.4.0). I also had a master node (data was disabled on it) and 2 other nodes with (box_type="warm"). TLDR: Removing the EDIT PEBCAK https://en.wiktionary.org/wiki/PEBCAK The actual property name is |
@robert-blankenship what did the allocation explain API say when the shard was unassigned? It looks to me like you used a setting that does not exist as such. The setting is The problem you had looks to me unrelated to the original issue here. |
You're right, thanks @ywelsch ! |
Curious if there is any movement on this as I just ran into the issue in 6.3.2 |
Pinging @elastic/es-distributed |
This is a fundamental problem with the current shard balancer and something that cannot be easily addressed in the current implementation. The current implementation uses an incremental approach to balancing that focuses on speed, but can sometimes end up in local minima. Our general advice is to avoid over-constraining the allocation settings. That said, we're considering alternatives to the current balancer, but these are all only at the research stage yet. |
I wonder if this is still issue after 8 years of being reported and known. Just tested with recent ES version 8.10.2, completely default settings. Easily reproducable on 3 nodes cluster. It almost always fails to allocate last shard when using these index settings:
It's clearly visible that correct allocation is possible - just move shard n1 to es02 and then shard n2 to es01. |
Pinging @elastic/es-distributed (Team:Distributed) |
Shared 5 will not get assigned after an upgrade from 1.5.0 to 1.6.0.
I tried to force a re-route w/ the following script but it didnt work
this is the only unassigned shared since the restart and I am not sure how to get it back to green. Any advice ?
Thanks
The text was updated successfully, but these errors were encountered: