Skip to content

Commit 2bdbc54

Browse files
committed
ILM Remove obsolete testRolloverAlreadyExists
The rollover action is now a retryable step (see elastic#48256) so ILM will keep retrying until it succeeds as opposed to stopping and moving the execution in the ERROR step. Fixes elastic#49073
1 parent c1c7fa5 commit 2bdbc54

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java

-36
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.elasticsearch.test.rest.ESRestTestCase;
2727
import org.elasticsearch.xpack.core.ilm.AllocateAction;
2828
import org.elasticsearch.xpack.core.ilm.DeleteAction;
29-
import org.elasticsearch.xpack.core.ilm.ErrorStep;
3029
import org.elasticsearch.xpack.core.ilm.ForceMergeAction;
3130
import org.elasticsearch.xpack.core.ilm.FreezeAction;
3231
import org.elasticsearch.xpack.core.ilm.LifecycleAction;
@@ -40,7 +39,6 @@
4039
import org.elasticsearch.xpack.core.ilm.ShrinkStep;
4140
import org.elasticsearch.xpack.core.ilm.Step.StepKey;
4241
import org.elasticsearch.xpack.core.ilm.TerminalPolicyStep;
43-
import org.elasticsearch.xpack.core.ilm.WaitForRolloverReadyStep;
4442
import org.hamcrest.Matchers;
4543
import org.junit.Before;
4644

@@ -290,40 +288,6 @@ public void testRolloverActionWithIndexingComplete() throws Exception {
290288
assertBusy(() -> assertEquals("true", getOnlyIndexSettings(originalIndex).get(LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE)));
291289
}
292290

293-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/49073")
294-
public void testRolloverAlreadyExists() throws Exception {
295-
String originalIndex = index + "-000001";
296-
String secondIndex = index + "-000002";
297-
createIndexWithSettings(originalIndex, Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
298-
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0)
299-
.put(RolloverAction.LIFECYCLE_ROLLOVER_ALIAS, "alias")
300-
);
301-
302-
// create policy
303-
createNewSingletonPolicy("hot", new RolloverAction(null, null, 1L));
304-
// update policy on index
305-
updatePolicy(originalIndex, policy);
306-
// Manually create the new index
307-
Request request = new Request("PUT", "/" + secondIndex);
308-
request.setJsonEntity("{\n \"settings\": " + Strings.toString(Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
309-
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0).build()) + "}");
310-
client().performRequest(request);
311-
// wait for the shards to initialize
312-
ensureGreen(secondIndex);
313-
// index another doc to trigger the policy
314-
index(client(), originalIndex, "_id", "foo", "bar");
315-
assertBusy(() -> {
316-
Map<String, Object> explainIndexResponse = explainIndex(originalIndex);
317-
logger.info(originalIndex + ": " + getStepKey(explainIndexResponse));
318-
logger.info(secondIndex + ": " + getStepKeyForIndex(secondIndex));
319-
assertThat(getStepKey(explainIndexResponse), equalTo(new StepKey("hot", RolloverAction.NAME, ErrorStep.NAME)));
320-
assertThat(explainIndexResponse.get("failed_step"), equalTo(WaitForRolloverReadyStep.NAME));
321-
@SuppressWarnings("unchecked")
322-
String reason = ((Map<String, String>) explainIndexResponse.get("step_info")).get("reason");
323-
assertThat(reason, containsString("already exists"));
324-
});
325-
}
326-
327291
public void testAllocateOnlyAllocation() throws Exception {
328292
createIndexWithSettings(index, Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 2)
329293
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0));

0 commit comments

Comments
 (0)