Tests: Remove RelocationTests.testRelocationWithBusyClusterUpdateThread.

It is not relevant anymore with synchronous mapping updates.
This commit is contained in:
Adrien Grand 2015-05-19 10:37:45 +02:00
parent df5ffb1418
commit 17d65a5f90
1 changed files with 0 additions and 94 deletions

View File

@ -444,100 +444,6 @@ public class RelocationTests extends ElasticsearchIntegrationTest {
assertTrue(stateResponse.getState().readOnlyRoutingNodes().node(blueNodeId).isEmpty());
}
@Test
@Slow
@TestLogging("cluster.service:TRACE,indices.recovery:TRACE")
@AwaitsFix(bugUrl="Fails now that we removed the mapping update from phase 2 in #11207")
public void testRelocationWithBusyClusterUpdateThread() throws Exception {
final String indexName = "test";
final Settings settings = ImmutableSettings.builder()
.put("gateway.type", "local")
.put(DiscoverySettings.PUBLISH_TIMEOUT, "1s")
.put("indices.recovery.internal_action_timeout", "1s").build();
String master = internalCluster().startNode(settings);
ensureGreen();
List<String> nodes = internalCluster().startNodesAsync(2, settings).get();
final String node1 = nodes.get(0);
final String node2 = nodes.get(1);
ClusterHealthResponse response = client().admin().cluster().prepareHealth().setWaitForNodes("3").get();
assertThat(response.isTimedOut(), is(false));
client().admin().indices().prepareCreate(indexName)
.setSettings(
ImmutableSettings.builder()
.put(FilterAllocationDecider.INDEX_ROUTING_INCLUDE_GROUP + "_name", node1)
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0)
).get();
List<IndexRequestBuilder> requests = new ArrayList<>();
int numDocs = scaledRandomIntBetween(25, 250);
for (int i = 0; i < numDocs; i++) {
requests.add(client().prepareIndex(indexName, "type").setCreate(true).setSource("{}"));
}
indexRandom(true, requests);
ensureSearchable(indexName);
// capture the incoming state indicate that the replicas have upgraded and assigned
final CountDownLatch allReplicasAssigned = new CountDownLatch(1);
final CountDownLatch releaseClusterState = new CountDownLatch(1);
final CountDownLatch unassignedShardsAfterReplicasAssigned = new CountDownLatch(1);
try {
internalCluster().getInstance(ClusterService.class, node1).addLast(new ClusterStateListener() {
@Override
public void clusterChanged(ClusterChangedEvent event) {
ClusterState state = event.state();
if (state.routingTable().allShards().size() == 1 || state.routingNodes().hasUnassignedShards()) {
// we have no replicas or they are not assigned yet
return;
}
allReplicasAssigned.countDown();
try {
releaseClusterState.await();
} catch (InterruptedException e) {
//
}
}
});
internalCluster().getInstance(ClusterService.class, master).addLast(new ClusterStateListener() {
@Override
public void clusterChanged(ClusterChangedEvent event) {
if (event.state().routingNodes().hasUnassigned() && allReplicasAssigned.getCount() == 0) {
unassignedShardsAfterReplicasAssigned.countDown();
}
}
});
logger.info("--> starting replica recovery");
// we don't expect this to be acknowledge by node1 where we block the cluster state thread
assertFalse(client().admin().indices().prepareUpdateSettings(indexName)
.setSettings(ImmutableSettings.builder()
.put(FilterAllocationDecider.INDEX_ROUTING_INCLUDE_GROUP + "_name", node1 + "," + node2)
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 1)
).setTimeout("200ms")
.get().isAcknowledged());
logger.info("--> waiting for node1 to process replica existence");
allReplicasAssigned.await();
logger.info("--> waiting for recovery to fail");
unassignedShardsAfterReplicasAssigned.await();
} finally {
logger.info("--> releasing cluster state update thread");
releaseClusterState.countDown();
}
logger.info("--> waiting for recovery to succeed");
// force a move.
client().admin().cluster().prepareReroute().get();
ensureGreen();
}
@Test
@Slow
public void testCancellationCleansTempFiles() throws Exception {