|
26 | 26 | import org.elasticsearch.test.rest.ESRestTestCase;
|
27 | 27 | import org.elasticsearch.xpack.core.ilm.AllocateAction;
|
28 | 28 | import org.elasticsearch.xpack.core.ilm.DeleteAction;
|
29 |
| -import org.elasticsearch.xpack.core.ilm.ErrorStep; |
30 | 29 | import org.elasticsearch.xpack.core.ilm.ForceMergeAction;
|
31 | 30 | import org.elasticsearch.xpack.core.ilm.FreezeAction;
|
32 | 31 | import org.elasticsearch.xpack.core.ilm.LifecycleAction;
|
|
40 | 39 | import org.elasticsearch.xpack.core.ilm.ShrinkStep;
|
41 | 40 | import org.elasticsearch.xpack.core.ilm.Step.StepKey;
|
42 | 41 | import org.elasticsearch.xpack.core.ilm.TerminalPolicyStep;
|
43 |
| -import org.elasticsearch.xpack.core.ilm.WaitForRolloverReadyStep; |
44 | 42 | import org.hamcrest.Matchers;
|
45 | 43 | import org.junit.Before;
|
46 | 44 |
|
@@ -290,39 +288,6 @@ public void testRolloverActionWithIndexingComplete() throws Exception {
|
290 | 288 | assertBusy(() -> assertEquals("true", getOnlyIndexSettings(originalIndex).get(LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE)));
|
291 | 289 | }
|
292 | 290 |
|
293 |
| - public void testRolloverAlreadyExists() throws Exception { |
294 |
| - String originalIndex = index + "-000001"; |
295 |
| - String secondIndex = index + "-000002"; |
296 |
| - createIndexWithSettings(originalIndex, Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1) |
297 |
| - .put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0) |
298 |
| - .put(RolloverAction.LIFECYCLE_ROLLOVER_ALIAS, "alias") |
299 |
| - ); |
300 |
| - |
301 |
| - // create policy |
302 |
| - createNewSingletonPolicy("hot", new RolloverAction(null, null, 1L)); |
303 |
| - // update policy on index |
304 |
| - updatePolicy(originalIndex, policy); |
305 |
| - // Manually create the new index |
306 |
| - Request request = new Request("PUT", "/" + secondIndex); |
307 |
| - request.setJsonEntity("{\n \"settings\": " + Strings.toString(Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1) |
308 |
| - .put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0).build()) + "}"); |
309 |
| - client().performRequest(request); |
310 |
| - // wait for the shards to initialize |
311 |
| - ensureGreen(secondIndex); |
312 |
| - // index another doc to trigger the policy |
313 |
| - index(client(), originalIndex, "_id", "foo", "bar"); |
314 |
| - assertBusy(() -> { |
315 |
| - Map<String, Object> explainIndexResponse = explainIndex(originalIndex); |
316 |
| - logger.info(originalIndex + ": " + getStepKey(explainIndexResponse)); |
317 |
| - logger.info(secondIndex + ": " + getStepKeyForIndex(secondIndex)); |
318 |
| - assertThat(getStepKey(explainIndexResponse), equalTo(new StepKey("hot", RolloverAction.NAME, ErrorStep.NAME))); |
319 |
| - assertThat(explainIndexResponse.get("failed_step"), equalTo(WaitForRolloverReadyStep.NAME)); |
320 |
| - @SuppressWarnings("unchecked") |
321 |
| - String reason = ((Map<String, String>) explainIndexResponse.get("step_info")).get("reason"); |
322 |
| - assertThat(reason, containsString("already exists")); |
323 |
| - }); |
324 |
| - } |
325 |
| - |
326 | 291 | public void testAllocateOnlyAllocation() throws Exception {
|
327 | 292 | createIndexWithSettings(index, Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 2)
|
328 | 293 | .put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0));
|
|
0 commit comments