Skip to content

Commit 8252eae

Browse files
committed
No need to reroute (check for possible shard allocations) when a new *non* data node is added to the cluster, closes elastic#1368.
1 parent d1494c9 commit 8252eae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/RoutingService.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.elasticsearch.cluster.ClusterState;
2626
import org.elasticsearch.cluster.ClusterStateListener;
2727
import org.elasticsearch.cluster.ClusterStateUpdateTask;
28+
import org.elasticsearch.cluster.node.DiscoveryNode;
2829
import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
2930
import org.elasticsearch.cluster.routing.allocation.ShardsAllocation;
3031
import org.elasticsearch.common.component.AbstractLifecycleComponent;
@@ -103,7 +104,12 @@ public class RoutingService extends AbstractLifecycleComponent<RoutingService> i
103104
// reroute();
104105
} else {
105106
if (event.nodesAdded()) {
106-
routingTableDirty = true;
107+
for (DiscoveryNode node : event.nodesDelta().addedNodes()) {
108+
if (node.dataNode()) {
109+
routingTableDirty = true;
110+
break;
111+
}
112+
}
107113
}
108114
}
109115
} else {

0 commit comments

Comments
 (0)