Skip to content

Commit 590fa2e

Browse files
committed
ILM Remove obsolete testRolloverAlreadyExists (elastic#49104)
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 (cherry picked from commit 3ae9089) Signed-off-by: Andrei Dan <[email protected]> # Conflicts: # x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java
1 parent f5f0e13 commit 590fa2e

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

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

-35
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,39 +288,6 @@ public void testRolloverActionWithIndexingComplete() throws Exception {
290288
assertBusy(() -> assertEquals("true", getOnlyIndexSettings(originalIndex).get(LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE)));
291289
}
292290

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-
326291
public void testAllocateOnlyAllocation() throws Exception {
327292
createIndexWithSettings(index, Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 2)
328293
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0));

0 commit comments

Comments
 (0)