From 4088236cf75b793c7a2a80f5f7be5b326b607378 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Tue, 27 Sep 2011 13:47:59 +0300 Subject: [PATCH] No need to reroute (check for possible shard allocations) when a new *non* data node is added to the cluster, closes #1368. --- .../org/elasticsearch/cluster/routing/RoutingService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/RoutingService.java b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/RoutingService.java index f16d9c4ed24..951c6ffde22 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/RoutingService.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/RoutingService.java @@ -25,6 +25,7 @@ import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterStateListener; import org.elasticsearch.cluster.ClusterStateUpdateTask; +import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.allocation.AllocationService; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.common.component.AbstractLifecycleComponent; @@ -103,7 +104,12 @@ public class RoutingService extends AbstractLifecycleComponent i // reroute(); } else { if (event.nodesAdded()) { - routingTableDirty = true; + for (DiscoveryNode node : event.nodesDelta().addedNodes()) { + if (node.dataNode()) { + routingTableDirty = true; + break; + } + } } } } else {