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
Take initializing shards into consideration during awareness allocation #12551
Conversation
This looks good to me, but I think @s1monw should take a look also just to make sure. Also, not sure about where this should go, @clintongormley what do you think? |
@@ -763,7 +763,7 @@ public void fullAwareness3() { | |||
} | |||
|
|||
@Test | |||
public void testUnbalancedZones() { | |||
public void testUnbalancedZones1() { |
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.
can we get a better name for this?
left trivial comments - LGTM though |
I think we should let it bake on master and 2.x and if it's stable port to 2.0? |
It makes decision consistent. Fixes elastic#12522
Thanks. Updated test names. |
if you push to 1.7 you also need to push to 2.0 otherwise this makes no sense |
oh... pushed to 2.0 as well. |
@@ -188,7 +188,7 @@ private Decision underCapacity(ShardRouting shardRouting, RoutingNode node, Rout | |||
if (assignedShard.relocating()) { | |||
RoutingNode relocationNode = allocation.routingNodes().node(assignedShard.relocatingNodeId()); | |||
shardPerAttribute.addTo(relocationNode.node().attributes().get(awarenessAttribute), 1); | |||
} else if (assignedShard.started()) { | |||
} else if (assignedShard.started() || assignedShard.initializing()) { |
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.
This means we are counting target relocation shards twice. Once with the source shards, and once here. We can remove the assignedShard.relocating part yet.
Late to the party, but I think there is a problem with this fix. Left a comment on it. The fact we didn't catch it also means our tests are not strong enough. @masaruh let me know if you want to continue here, o.w. I'll pick it up. |
Previous fix elastic#12551 counted twice for relocating shard (source and target). Fix it to consider only target node.
Previous fix #12551 counted twice for relocating shard (source and target). Fix it to consider only target node.
Previous fix #12551 counted twice for relocating shard (source and target). Fix it to consider only target node.
Previous fix #12551 counted twice for relocating shard (source and target). Fix it to consider only target node.
It makes decision consistent.
Fixes #12522