|
32 | 32 | import org.elasticsearch.xpack.core.ilm.ErrorStep;
|
33 | 33 | import org.elasticsearch.xpack.core.ilm.ForceMergeAction;
|
34 | 34 | import org.elasticsearch.xpack.core.ilm.FreezeAction;
|
| 35 | +import org.elasticsearch.xpack.core.ilm.FreezeStep; |
35 | 36 | import org.elasticsearch.xpack.core.ilm.InitializePolicyContextStep;
|
36 | 37 | import org.elasticsearch.xpack.core.ilm.LifecycleAction;
|
37 | 38 | import org.elasticsearch.xpack.core.ilm.LifecyclePolicy;
|
@@ -228,6 +229,25 @@ public void testRetryFailedDeleteAction() throws Exception {
|
228 | 229 | assertBusy(() -> assertFalse(indexExists(index)));
|
229 | 230 | }
|
230 | 231 |
|
| 232 | + public void testRetryFreezeDeleteAction() throws Exception { |
| 233 | + createNewSingletonPolicy("cold", new FreezeAction()); |
| 234 | + |
| 235 | + createIndexWithSettings(index, Settings.builder() |
| 236 | + .put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1) |
| 237 | + .put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0) |
| 238 | + .put(IndexMetaData.SETTING_READ_ONLY, true) |
| 239 | + .put("index.lifecycle.name", policy)); |
| 240 | + |
| 241 | + assertBusy(() -> assertThat(getFailedStepForIndex(index), equalTo(FreezeStep.NAME))); |
| 242 | + assertFalse(getOnlyIndexSettings(index).containsKey("index.frozen")); |
| 243 | + |
| 244 | + Request request = new Request("PUT", index + "/_settings"); |
| 245 | + request.setJsonEntity("{\"index.blocks.read_only\":false}"); |
| 246 | + assertOK(client().performRequest(request)); |
| 247 | + |
| 248 | + assertBusy(() -> assertThat(getOnlyIndexSettings(index).get("index.frozen"), equalTo("true"))); |
| 249 | + } |
| 250 | + |
231 | 251 | public void testRetryFailedShrinkAction() throws Exception {
|
232 | 252 | int numShards = 4;
|
233 | 253 | int divisor = randomFrom(2, 4);
|
|
0 commit comments