Check allocation rules are cleared after ILM Shrink
Adds some checks to make sure that the allocation rules that ILM adds
before a shrink are cleared after the shrink is complete
@@ -60,6 +60,7 @@ import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.nullValue;
public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
private String index;
@@ -219,6 +220,7 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
assertThat(getStepKeyForIndex(shrunkenIndex), equalTo(TerminalPolicyStep.KEY));
assertThat(settings.get(IndexMetaData.SETTING_NUMBER_OF_SHARDS), equalTo(String.valueOf(expectedFinalShards)));
assertThat(settings.get(IndexMetaData.INDEX_BLOCKS_WRITE_SETTING.getKey()), equalTo("true"));
+ assertThat(settings.get(IndexMetaData.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id"), nullValue());
});
expectThrows(ResponseException.class, this::indexDocument);
}
@@ -462,6 +464,7 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
assertThat(getStepKeyForIndex(shrunkenIndex), equalTo(TerminalPolicyStep.KEY));
assertThat(settings.get(IndexMetaData.SETTING_NUMBER_OF_SHARDS), equalTo(String.valueOf(expectedFinalShards)));
assertThat(settings.get(IndexMetaData.INDEX_BLOCKS_WRITE_SETTING.getKey()), equalTo("true"));
+ assertThat(settings.get(IndexMetaData.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id"), nullValue());
});
expectThrows(ResponseException.class, this::indexDocument);
}
@@ -481,6 +484,7 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
assertThat(getStepKeyForIndex(index), equalTo(TerminalPolicyStep.KEY));
assertThat(settings.get(IndexMetaData.SETTING_NUMBER_OF_SHARDS), equalTo(String.valueOf(numberOfShards)));
assertNull(settings.get(IndexMetaData.INDEX_BLOCKS_WRITE_SETTING.getKey()));
+ assertThat(settings.get(IndexMetaData.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id"), nullValue());
});
}
@@ -524,6 +528,7 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
assertThat(getStepKeyForIndex(shrunkenIndex), equalTo(TerminalPolicyStep.KEY));
assertThat(settings.get(IndexMetaData.SETTING_NUMBER_OF_SHARDS), equalTo(String.valueOf(1)));
assertThat(settings.get(IndexMetaData.INDEX_BLOCKS_WRITE_SETTING.getKey()), equalTo("true"));
+ assertThat(settings.get(IndexMetaData.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id"), nullValue());
}, 2, TimeUnit.MINUTES);
expectThrows(ResponseException.class, this::indexDocument);
// assert that snapshot succeeded
