|
@@ -80,6 +80,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_CREATION_
|
|
|
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS;
|
|
|
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS;
|
|
|
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_VERSION_CREATED;
|
|
|
+import static org.elasticsearch.cluster.routing.RoutingTableTests.updateActiveAllocations;
|
|
|
import static org.elasticsearch.test.ClusterServiceUtils.createClusterService;
|
|
|
import static org.elasticsearch.test.ClusterServiceUtils.setState;
|
|
|
import static org.elasticsearch.cluster.ESAllocationTestCase.createAllocationService;
|
|
@@ -596,7 +597,6 @@ public class NodeJoinControllerTests extends ESTestCase {
|
|
|
.put(SETTING_VERSION_CREATED, Version.CURRENT)
|
|
|
.put(SETTING_NUMBER_OF_SHARDS, 1).put(SETTING_NUMBER_OF_REPLICAS, 1)
|
|
|
.put(SETTING_CREATION_DATE, System.currentTimeMillis())).build();
|
|
|
- stateBuilder.metaData(MetaData.builder().put(indexMetaData, false).generateClusterUuidIfNeeded());
|
|
|
IndexRoutingTable.Builder indexRoutingTableBuilder = IndexRoutingTable.builder(indexMetaData.getIndex());
|
|
|
RoutingTable.Builder routing = new RoutingTable.Builder();
|
|
|
routing.addAsNew(indexMetaData);
|
|
@@ -619,7 +619,10 @@ public class NodeJoinControllerTests extends ESTestCase {
|
|
|
ShardRoutingState.UNASSIGNED, new UnassignedInfo(UnassignedInfo.Reason.INDEX_CREATED, "life sucks")));
|
|
|
}
|
|
|
indexRoutingTableBuilder.addIndexShard(indexShardRoutingBuilder.build());
|
|
|
- stateBuilder.routingTable(RoutingTable.builder().add(indexRoutingTableBuilder.build()).build());
|
|
|
+ IndexRoutingTable indexRoutingTable = indexRoutingTableBuilder.build();
|
|
|
+ IndexMetaData updatedIndexMetaData = updateActiveAllocations(indexRoutingTable, indexMetaData);
|
|
|
+ stateBuilder.metaData(MetaData.builder().put(updatedIndexMetaData, false).generateClusterUuidIfNeeded())
|
|
|
+ .routingTable(RoutingTable.builder().add(indexRoutingTable).build());
|
|
|
}
|
|
|
|
|
|
setState(clusterService, stateBuilder.build());
|