|
|
@@ -28,6 +28,7 @@ import org.elasticsearch.index.IndexSettings;
|
|
|
import org.elasticsearch.test.rest.ESRestTestCase;
|
|
|
import org.elasticsearch.xpack.core.ilm.AllocateAction;
|
|
|
import org.elasticsearch.xpack.core.ilm.DeleteAction;
|
|
|
+import org.elasticsearch.xpack.core.ilm.DeleteStep;
|
|
|
import org.elasticsearch.xpack.core.ilm.ErrorStep;
|
|
|
import org.elasticsearch.xpack.core.ilm.ForceMergeAction;
|
|
|
import org.elasticsearch.xpack.core.ilm.FreezeAction;
|
|
|
@@ -206,6 +207,27 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
|
|
|
assertBusy(() -> assertFalse(indexExists(shrunkenOriginalIndex)));
|
|
|
}
|
|
|
|
|
|
+ public void testRetryFailedDeleteAction() throws Exception {
|
|
|
+ createIndexWithSettings(index, Settings.builder()
|
|
|
+ .put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
|
|
|
+ .put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0)
|
|
|
+ .put(IndexMetaData.SETTING_READ_ONLY_ALLOW_DELETE, false));
|
|
|
+
|
|
|
+ createNewSingletonPolicy("delete", new DeleteAction());
|
|
|
+
|
|
|
+ Request request = new Request("PUT", index + "/_settings");
|
|
|
+ request.setJsonEntity("{\"index.blocks.read_only\": true, \"index.lifecycle.name\": \"" + policy + "\"}");
|
|
|
+ assertOK(client().performRequest(request));
|
|
|
+
|
|
|
+ assertBusy(() -> assertThat(getFailedStepForIndex(index), equalTo(DeleteStep.NAME)));
|
|
|
+ assertTrue(indexExists(index));
|
|
|
+
|
|
|
+ request.setJsonEntity("{\"index.blocks.read_only\":false}");
|
|
|
+ assertOK(client().performRequest(request));
|
|
|
+
|
|
|
+ assertBusy(() -> assertFalse(indexExists(index)));
|
|
|
+ }
|
|
|
+
|
|
|
public void testRetryFailedShrinkAction() throws Exception {
|
|
|
int numShards = 4;
|
|
|
int divisor = randomFrom(2, 4);
|