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.
Should we do it even if shard is ignored?
There was a problem hiding this comment.
I am writing a unit test for this
There was a problem hiding this comment.
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.
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.
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 |
No description provided.