Skip to content

Commit 9e6540c

Browse files
committed
Add Downsample Action to unfollow injection logic
1 parent 5c48295 commit 9e6540c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ public List<Phase> getOrderedPhases(Map<String, Phase> phases) {
132132
if (actions.containsKey(UnfollowAction.NAME) == false
133133
&& (actions.containsKey(RolloverAction.NAME)
134134
|| actions.containsKey(ShrinkAction.NAME)
135-
|| actions.containsKey(SearchableSnapshotAction.NAME))) {
135+
|| actions.containsKey(SearchableSnapshotAction.NAME)
136+
|| actions.containsKey(DownsampleAction.NAME))) {
136137
Map<String, LifecycleAction> actionMap = new HashMap<>(phase.getActions());
137138
actionMap.put(UnfollowAction.NAME, UnfollowAction.INSTANCE);
138139
phase = new Phase(phase.getName(), phase.getMinimumAge(), actionMap);

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleTypeTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ public void testUnfollowInjections() {
476476
assertTrue(isUnfollowInjected("cold", SearchableSnapshotAction.NAME));
477477
assertTrue(isUnfollowInjected("frozen", SearchableSnapshotAction.NAME));
478478

479+
assertTrue(isUnfollowInjected("warm", DownsampleAction.NAME));
480+
assertTrue(isUnfollowInjected("cold", DownsampleAction.NAME));
481+
479482
assertFalse(isUnfollowInjected("hot", SetPriorityAction.NAME));
480483
assertFalse(isUnfollowInjected("warm", SetPriorityAction.NAME));
481484
assertFalse(isUnfollowInjected("warm", AllocateAction.NAME));

0 commit comments

Comments
 (0)