Skip to content

[ILM & TSDS] Inject an unfollow action before executing a downsample action. #128128

Open
@gmarouli

Description

@gmarouli

When an index alias/data stream is replicated via CCR, the follower index needs to unfollow the leader index before executing actions that will remove the original index. As the docs recommend:

This action is triggered automatically by the rollover, shrink, and searchable snapshot actions when they are applied to follower indices.

Expected behaviour
The downsample action is also an action that removes the original index so the expected behaviour is that ILM would automatically unfollow.

Observed behaviour
ILM does not inject the unfollow action as you can see in the following snippet:

if (actions.containsKey(UnfollowAction.NAME) == false
&& (actions.containsKey(RolloverAction.NAME)
|| actions.containsKey(ShrinkAction.NAME)
|| actions.containsKey(SearchableSnapshotAction.NAME))) {
Map<String, LifecycleAction> actionMap = new HashMap<>(phase.getActions());
actionMap.put(UnfollowAction.NAME, UnfollowAction.INSTANCE);
phase = new Phase(phase.getName(), phase.getMinimumAge(), actionMap);
}

In other words we need to add the downsample action in this if statement.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions