|
@@ -32,6 +32,7 @@ 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;
|
|
|
+import org.elasticsearch.xpack.core.ilm.FreezeStep;
|
|
|
import org.elasticsearch.xpack.core.ilm.InitializePolicyContextStep;
|
|
|
import org.elasticsearch.xpack.core.ilm.LifecycleAction;
|
|
|
import org.elasticsearch.xpack.core.ilm.LifecyclePolicy;
|
|
@@ -228,6 +229,25 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
|
|
|
assertBusy(() -> assertFalse(indexExists(index)));
|
|
|
}
|
|
|
|
|
|
+ public void testRetryFreezeDeleteAction() throws Exception {
|
|
|
+ createNewSingletonPolicy("cold", new FreezeAction());
|
|
|
+
|
|
|
+ createIndexWithSettings(index, Settings.builder()
|
|
|
+ .put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
|
|
|
+ .put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0)
|
|
|
+ .put(IndexMetaData.SETTING_READ_ONLY, true)
|
|
|
+ .put("index.lifecycle.name", policy));
|
|
|
+
|
|
|
+ assertBusy(() -> assertThat(getFailedStepForIndex(index), equalTo(FreezeStep.NAME)));
|
|
|
+ assertFalse(getOnlyIndexSettings(index).containsKey("index.frozen"));
|
|
|
+
|
|
|
+ Request request = new Request("PUT", index + "/_settings");
|
|
|
+ request.setJsonEntity("{\"index.blocks.read_only\":false}");
|
|
|
+ assertOK(client().performRequest(request));
|
|
|
+
|
|
|
+ assertBusy(() -> assertThat(getOnlyIndexSettings(index).get("index.frozen"), equalTo("true")));
|
|
|
+ }
|
|
|
+
|
|
|
public void testRetryFailedShrinkAction() throws Exception {
|
|
|
int numShards = 4;
|
|
|
int divisor = randomFrom(2, 4);
|