diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/AllocationIdIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/AllocationIdIT.java index 2fd05cd2800..3832b79e901 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/AllocationIdIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/AllocationIdIT.java @@ -136,20 +136,16 @@ public class AllocationIdIT extends ESIntegTestCase { assertThat(shardRouting.unassignedInfo().getReason(), equalTo(UnassignedInfo.Reason.ALLOCATION_FAILED)); }); + internalCluster().stopRandomNode(InternalTestCluster.nameFilter(node1)); try(Store store = new Store(shardId, indexSettings, new SimpleFSDirectory(indexPath), new DummyShardLock(shardId))) { store.removeCorruptionMarker(); } + node1 = internalCluster().startNode(node1DataPathSettings); // index is red: no any shard is allocated (allocation id is a fake id that does not match to anything) checkHealthStatus(indexName, ClusterHealthStatus.RED); checkNoValidShardCopy(indexName, shardId); - internalCluster().restartNode(node1, InternalTestCluster.EMPTY_CALLBACK); - - // index is still red due to mismatch of allocation id - checkHealthStatus(indexName, ClusterHealthStatus.RED); - checkNoValidShardCopy(indexName, shardId); - // no any valid shard is there; have to invoke AllocateStalePrimary again client().admin().cluster().prepareReroute() .add(new AllocateStalePrimaryAllocationCommand(indexName, 0, node1, true))