Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ public void performDuringNoSnapshot(IndexMetaData indexMetaData, ClusterState cu
public boolean indexSurvives() {
return false;
}

@Override
public boolean isRetryable() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;
Expand Down Expand Up @@ -206,6 +207,27 @@ public void testMoveToRolloverStep() throws Exception {
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);
Expand Down