remove check on if indices has an index, cluster state is enough

This commit is contained in:
kimchy 2010-10-19 16:42:39 +02:00
parent 4c8978237f
commit 5635260922
1 changed files with 2 additions and 2 deletions

View File

@ -250,7 +250,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
public boolean start(final boolean fromClusterEvent) throws ElasticSearchException { public boolean start(final boolean fromClusterEvent) throws ElasticSearchException {
ClusterState clusterState = clusterService.state(); ClusterState clusterState = clusterService.state();
nodes = clusterState.nodes(); nodes = clusterState.nodes();
if (!indicesService.hasIndex(request.index()) || !clusterState.routingTable().hasIndex(request.index())) { if (!clusterState.routingTable().hasIndex(request.index())) {
retryPrimary(fromClusterEvent, null); retryPrimary(fromClusterEvent, null);
return false; return false;
} }
@ -264,7 +264,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
boolean foundPrimary = false; boolean foundPrimary = false;
for (final ShardRouting shard : shards) { for (final ShardRouting shard : shards) {
if (shard.primary()) { if (shard.primary()) {
if (!shard.active() || !nodes.nodeExists(shard.currentNodeId()) || !indicesService.hasIndex(request.index())) { if (!shard.active() || !nodes.nodeExists(shard.currentNodeId())) {
retryPrimary(fromClusterEvent, shard.shardId()); retryPrimary(fromClusterEvent, shard.shardId());
return false; return false;
} }