-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Initialize shards assuming they would be placed on original nodes #90600
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
Initialize shards assuming they would be placed on original nodes #90600
Conversation
|
Pinging @elastic/es-distributed (Team:Distributed) |
| if (info != null | ||
| && info.getLastAllocatedNodeId() != null | ||
| && routingNodes.node(info.getLastAllocatedNodeId()) != null | ||
| && ignoredShards.contains(shardRouting) == false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do it even if shard is ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am writing a unit test for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we only want to do this if a shard is ignored because that indicates the GatewayAllocator is still taking responsibility for it (and therefore we expect will eventually assign it). If the shard is not ignored then its last-allocated ID shouldn't be relevant, it's effectively a new shard and should be left for the delegate allocator.
DaveCTurner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one comment nit.
...rc/main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceInput.java
Show resolved
Hide resolved
...rc/main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceInput.java
Show resolved
Hide resolved
| if (info != null | ||
| && info.getLastAllocatedNodeId() != null | ||
| && routingNodes.node(info.getLastAllocatedNodeId()) != null | ||
| && ignoredShards.contains(shardRouting) == false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we only want to do this if a shard is ignored because that indicates the GatewayAllocator is still taking responsibility for it (and therefore we expect will eventually assign it). If the shard is not ignored then its last-allocated ID shouldn't be relevant, it's effectively a new shard and should be left for the delegate allocator.
|
We discussed in another channel - this approach doesn't quite work because it might try and assign a replica before its primary. Instead we should incorporate the previous node ID into the |
DaveCTurner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM again
No description provided.