Skip to content

Commit d09ed93

Browse files
authored
Check allocation rules are cleared after ILM Shrink (#41170)
Adds some checks to make sure that the allocation rules that ILM adds before a shrink are cleared after the shrink is complete
1 parent 504a417 commit d09ed93

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/indexlifecycle/TimeSeriesLifecycleActionsIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import static org.hamcrest.Matchers.equalTo;
6060
import static org.hamcrest.Matchers.greaterThan;
6161
import static org.hamcrest.Matchers.not;
62+
import static org.hamcrest.Matchers.nullValue;
6263

6364
public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
6465
private String index;
@@ -218,6 +219,7 @@ public void testRetryFailedShrinkAction() throws Exception {
218219
assertThat(getStepKeyForIndex(shrunkenIndex), equalTo(TerminalPolicyStep.KEY));
219220
assertThat(settings.get(IndexMetaData.SETTING_NUMBER_OF_SHARDS), equalTo(String.valueOf(expectedFinalShards)));
220221
assertThat(settings.get(IndexMetaData.INDEX_BLOCKS_WRITE_SETTING.getKey()), equalTo("true"));
222+
assertThat(settings.get(IndexMetaData.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id"), nullValue());
221223
});
222224
expectThrows(ResponseException.class, this::indexDocument);
223225
}
@@ -461,6 +463,7 @@ public void testShrinkAction() throws Exception {
461463
assertThat(getStepKeyForIndex(shrunkenIndex), equalTo(TerminalPolicyStep.KEY));
462464
assertThat(settings.get(IndexMetaData.SETTING_NUMBER_OF_SHARDS), equalTo(String.valueOf(expectedFinalShards)));
463465
assertThat(settings.get(IndexMetaData.INDEX_BLOCKS_WRITE_SETTING.getKey()), equalTo("true"));
466+
assertThat(settings.get(IndexMetaData.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id"), nullValue());
464467
});
465468
expectThrows(ResponseException.class, this::indexDocument);
466469
}
@@ -480,6 +483,7 @@ public void testShrinkSameShards() throws Exception {
480483
assertThat(getStepKeyForIndex(index), equalTo(TerminalPolicyStep.KEY));
481484
assertThat(settings.get(IndexMetaData.SETTING_NUMBER_OF_SHARDS), equalTo(String.valueOf(numberOfShards)));
482485
assertNull(settings.get(IndexMetaData.INDEX_BLOCKS_WRITE_SETTING.getKey()));
486+
assertThat(settings.get(IndexMetaData.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id"), nullValue());
483487
});
484488
}
485489

@@ -523,6 +527,7 @@ public void testShrinkDuringSnapshot() throws Exception {
523527
assertThat(getStepKeyForIndex(shrunkenIndex), equalTo(TerminalPolicyStep.KEY));
524528
assertThat(settings.get(IndexMetaData.SETTING_NUMBER_OF_SHARDS), equalTo(String.valueOf(1)));
525529
assertThat(settings.get(IndexMetaData.INDEX_BLOCKS_WRITE_SETTING.getKey()), equalTo("true"));
530+
assertThat(settings.get(IndexMetaData.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id"), nullValue());
526531
}, 2, TimeUnit.MINUTES);
527532
expectThrows(ResponseException.class, this::indexDocument);
528533
// assert that snapshot succeeded

0 commit comments

Comments
 (0)