Skip to content
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

Merged
merged 1 commit into from Sep 11, 2015

Conversation

Projects
None yet
6 participants
@masaruh
Copy link
Contributor

commented Jul 30, 2015

It makes decision consistent.
Fixes #12522

@dakrone

This comment has been minimized.

Copy link
Member

commented Aug 13, 2015

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?

@s1monw

View changes

core/src/test/java/org/elasticsearch/cluster/routing/allocation/AwarenessAllocationTests.java Outdated
@@ -763,7 +763,7 @@ public void fullAwareness3() {
}

@Test
public void testUnbalancedZones() {
public void testUnbalancedZones1() {

This comment has been minimized.

Copy link
@s1monw

s1monw Sep 10, 2015

Contributor

can we get a better name for this?

@s1monw

View changes

core/src/test/java/org/elasticsearch/cluster/routing/allocation/AwarenessAllocationTests.java Outdated
@@ -826,4 +826,45 @@ public void testUnbalancedZones() {
assertThat(clusterState.getRoutingNodes().node("A-0").size(), equalTo(3));
assertThat(clusterState.getRoutingNodes().node("B-0").size(), equalTo(5));
}

@Test
public void testUnbalancedZones2() {

This comment has been minimized.

Copy link
@s1monw

s1monw Sep 10, 2015

Contributor

same here :)

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2015

left trivial comments - LGTM though

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2015

I think we should let it bake on master and 2.x and if it's stable port to 2.0?

@masaruh masaruh force-pushed the masaruh:fix/12522 branch Sep 11, 2015

@masaruh masaruh force-pushed the masaruh:fix/12522 branch to 5ae00a6 Sep 11, 2015

@masaruh masaruh merged commit 5ae00a6 into elastic:master Sep 11, 2015

1 check passed

CLA Commit author is a member of Elasticsearch
Details
@masaruh

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2015

Thanks. Updated test names.
Pushed it to master, 2.x and 1.7 for now.

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2015

if you push to 1.7 you also need to push to 2.0 otherwise this makes no sense

@masaruh

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2015

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()) {

This comment has been minimized.

Copy link
@bleskes

bleskes Sep 11, 2015

Member

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.

@bleskes

This comment has been minimized.

Copy link
Member

commented Sep 11, 2015

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.

@masaruh

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2015

@bleskes you are right... Created #13512 (the test fails without the fix).

masaruh added a commit to masaruh/elasticsearch that referenced this pull request Sep 11, 2015

Take relocating shard into consideration during awareness allocation
Previous fix elastic#12551 counted twice for relocating shard (source and target).
Fix it to consider only target node.

masaruh added a commit that referenced this pull request Sep 11, 2015

Take relocating shard into consideration during awareness allocation
Previous fix #12551 counted twice for relocating shard (source and target).
Fix it to consider only target node.

masaruh added a commit that referenced this pull request Sep 11, 2015

Take relocating shard into consideration during awareness allocation
Previous fix #12551 counted twice for relocating shard (source and target).
Fix it to consider only target node.

masaruh added a commit that referenced this pull request Sep 11, 2015

Take relocating shard into consideration during awareness allocation
Previous fix #12551 counted twice for relocating shard (source and target).
Fix it to consider only target node.

@masaruh masaruh added v2.1.0 v5.0.0-alpha1 and removed review labels Sep 11, 2015

@clintongormley clintongormley added v2.0.0-beta2 and removed v2.0.0 labels Sep 14, 2015

@clintongormley clintongormley removed the v2.1.0 label Nov 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.