Skip to content

Commit

Permalink
Remove data_frozen node role (tier) and frozen ILM phase (elastic#62403)
Browse files Browse the repository at this point in the history
With the differentiation between searchable snapshots on the cold phase and searchable snapshots on
the frozen phase not implemented, there is no need to have a separate phase/tier for now. This
commit removes the frozen phase and tier, which can be added back at a later time.

(this tier was never in a released version, so this is not a breaking change)

Relates to elastic#60983
Relates to elastic#60994
Relates to elastic#60848
  • Loading branch information
dakrone committed Sep 16, 2020
1 parent 61ea9af commit a0ec343
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 210 deletions.
2 changes: 1 addition & 1 deletion docs/reference/ilm/actions/ilm-allocate.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[[ilm-allocate]]
=== Allocate

Phases allowed: warm, cold, frozen.
Phases allowed: warm, cold.

Updates the index settings to change which nodes are allowed to host the index shards
and change the number of replicas.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ilm/actions/ilm-freeze.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[[ilm-freeze]]
=== Freeze

Phases allowed: cold, frozen.
Phases allowed: cold.

<<frozen-indices, Freezes>> an index to minimize its memory footprint.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[[ilm-searchable-snapshot]]
=== Searchable snapshot

Phases allowed: cold, frozen.
Phases allowed: cold.

Takes a snapshot of the managed index in the configured repository
and mounts it as a searchable snapshot.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ilm/actions/ilm-set-priority.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[[ilm-set-priority]]
=== Set priority

Phases allowed: hot, warm, cold, frozen.
Phases allowed: hot, warm, cold.

Sets the <<recovery-prioritization, priority>> of the index as
soon as the policy enters the hot, warm, or cold phase.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ilm/actions/ilm-unfollow.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[[ilm-unfollow]]
=== Unfollow

Phases allowed: hot, warm, cold, frozen.
Phases allowed: hot, warm, cold.

Converts a {ref}/ccr-apis.html[{ccr-init}] follower index into a regular index.
This enables the shrink, rollover, and searchable snapshot actions
Expand Down
13 changes: 1 addition & 12 deletions docs/reference/ilm/ilm-index-lifecycle.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@
<titleabbrev>Index lifecycle</titleabbrev>
++++

{ilm-init} defines five index lifecycle _phases_:
{ilm-init} defines four index lifecycle _phases_:

* **Hot**: The index is actively being updated and queried.
* **Warm**: The index is no longer being updated but is still being queried.
* **Cold**: The index is no longer being updated and is seldom queried. The
information still needs to be searchable, but it's okay if those queries are
slower.
* **Frozen**: The index is no longer being updated and is seldom queried. The
queries are performing longer-term analyses for which a slower response is
acceptable.
* **Delete**: The index is no longer needed and can safely be removed.

An index's _lifecycle policy_ specifies which phases
Expand Down Expand Up @@ -97,14 +94,6 @@ the rollover criteria, it could be 20 minutes before the rollover is complete.
ifdef::permanently-unreleased-branch[]
- <<ilm-searchable-snapshot, Searchable Snapshot>>
endif::[]
* Frozen
- <<ilm-set-priority-action,Set Priority>>
- <<ilm-unfollow-action,Unfollow>>
- <<ilm-allocate,Allocate>>
- <<ilm-freeze,Freeze>>
ifdef::permanently-unreleased-branch[]
- <<ilm-searchable-snapshot, Searchable Snapshot>>
endif::[]
* Delete
- <<ilm-wait-for-snapshot-action,Wait For Snapshot>>
- <<ilm-delete,Delete>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

/**
* The {@code DataTier} class encapsulates the formalization of the "content",
* "hot", "warm", "cold", and "frozen" tiers as node roles. In contains the
* "hot", "warm", and "cold" tiers as node roles. In contains the
* roles themselves as well as helpers for validation and determining if a node
* has a tier configured.
*
Expand All @@ -33,7 +33,6 @@ public class DataTier {
public static final String DATA_HOT = "data_hot";
public static final String DATA_WARM = "data_warm";
public static final String DATA_COLD = "data_cold";
public static final String DATA_FROZEN = "data_frozen";

/**
* Returns true if the given tier name is a valid tier
Expand All @@ -42,8 +41,7 @@ public static boolean validTierName(String tierName) {
return DATA_CONTENT.equals(tierName) ||
DATA_HOT.equals(tierName) ||
DATA_WARM.equals(tierName) ||
DATA_COLD.equals(tierName) ||
DATA_FROZEN.equals(tierName);
DATA_COLD.equals(tierName);
}

/**
Expand Down Expand Up @@ -131,23 +129,6 @@ public boolean canContainData() {
}
};

public static DiscoveryNodeRole DATA_FROZEN_NODE_ROLE = new DiscoveryNodeRole("data_frozen", "f") {
@Override
public boolean isEnabledByDefault(final Settings settings) {
return false;
}

@Override
public Setting<Boolean> legacySetting() {
return null;
}

@Override
public boolean canContainData() {
return true;
}
};

public static boolean isContentNode(DiscoveryNode discoveryNode) {
return discoveryNode.getRoles().contains(DATA_CONTENT_NODE_ROLE) || discoveryNode.getRoles().contains(DiscoveryNodeRole.DATA_ROLE);
}
Expand All @@ -164,10 +145,6 @@ public static boolean isColdNode(DiscoveryNode discoveryNode) {
return discoveryNode.getRoles().contains(DATA_COLD_NODE_ROLE) || discoveryNode.getRoles().contains(DiscoveryNodeRole.DATA_ROLE);
}

public static boolean isFrozenNode(DiscoveryNode discoveryNode) {
return discoveryNode.getRoles().contains(DATA_FROZEN_NODE_ROLE) || discoveryNode.getRoles().contains(DiscoveryNodeRole.DATA_ROLE);
}

/**
* This setting provider injects the setting allocating all newly created indices with
* {@code index.routing.allocation.include._tier: "data_hot"} unless the user overrides the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ public Set<DiscoveryNodeRole> getRoles() {
DataTier.DATA_CONTENT_NODE_ROLE,
DataTier.DATA_HOT_NODE_ROLE,
DataTier.DATA_WARM_NODE_ROLE,
DataTier.DATA_COLD_NODE_ROLE,
DataTier.DATA_FROZEN_NODE_ROLE));
DataTier.DATA_COLD_NODE_ROLE));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,25 @@ public class TimeseriesLifecycleType implements LifecycleType {
static final String HOT_PHASE = "hot";
static final String WARM_PHASE = "warm";
static final String COLD_PHASE = "cold";
static final String FROZEN_PHASE = "frozen";
static final String DELETE_PHASE = "delete";
static final List<String> VALID_PHASES = Arrays.asList(HOT_PHASE, WARM_PHASE, COLD_PHASE, FROZEN_PHASE, DELETE_PHASE);
static final List<String> VALID_PHASES = Arrays.asList(HOT_PHASE, WARM_PHASE, COLD_PHASE, DELETE_PHASE);
static final List<String> ORDERED_VALID_HOT_ACTIONS = Arrays.asList(SetPriorityAction.NAME, UnfollowAction.NAME, RolloverAction.NAME,
ForceMergeAction.NAME);
static final List<String> ORDERED_VALID_WARM_ACTIONS = Arrays.asList(SetPriorityAction.NAME, UnfollowAction.NAME, ReadOnlyAction.NAME,
AllocateAction.NAME, ShrinkAction.NAME, ForceMergeAction.NAME);
static final List<String> ORDERED_VALID_COLD_ACTIONS = Arrays.asList(SetPriorityAction.NAME, UnfollowAction.NAME, AllocateAction.NAME,
FreezeAction.NAME, SearchableSnapshotAction.NAME);
static final List<String> ORDERED_VALID_FROZEN_ACTIONS = Arrays.asList(SetPriorityAction.NAME, UnfollowAction.NAME, AllocateAction.NAME,
FreezeAction.NAME, SearchableSnapshotAction.NAME);
static final List<String> ORDERED_VALID_DELETE_ACTIONS = Arrays.asList(WaitForSnapshotAction.NAME, DeleteAction.NAME);
static final Set<String> VALID_HOT_ACTIONS = Sets.newHashSet(ORDERED_VALID_HOT_ACTIONS);
static final Set<String> VALID_WARM_ACTIONS = Sets.newHashSet(ORDERED_VALID_WARM_ACTIONS);
static final Set<String> VALID_COLD_ACTIONS = Sets.newHashSet(ORDERED_VALID_COLD_ACTIONS);
static final Set<String> VALID_FROZEN_ACTIONS = Sets.newHashSet(ORDERED_VALID_FROZEN_ACTIONS);
static final Set<String> VALID_DELETE_ACTIONS = Sets.newHashSet(ORDERED_VALID_DELETE_ACTIONS);
private static Map<String, Set<String>> ALLOWED_ACTIONS = new HashMap<>();

static {
ALLOWED_ACTIONS.put(HOT_PHASE, VALID_HOT_ACTIONS);
ALLOWED_ACTIONS.put(WARM_PHASE, VALID_WARM_ACTIONS);
ALLOWED_ACTIONS.put(COLD_PHASE, VALID_COLD_ACTIONS);
ALLOWED_ACTIONS.put(FROZEN_PHASE, VALID_FROZEN_ACTIONS);
ALLOWED_ACTIONS.put(DELETE_PHASE, VALID_DELETE_ACTIONS);
}

Expand Down Expand Up @@ -146,9 +141,6 @@ public List<LifecycleAction> getOrderedActions(Phase phase) {
case COLD_PHASE:
return ORDERED_VALID_COLD_ACTIONS.stream().map(a -> actions.getOrDefault(a, null))
.filter(Objects::nonNull).collect(Collectors.toList());
case FROZEN_PHASE:
return ORDERED_VALID_FROZEN_ACTIONS.stream().map(a -> actions.getOrDefault(a, null))
.filter(Objects::nonNull).collect(Collectors.toList());
case DELETE_PHASE:
return ORDERED_VALID_DELETE_ACTIONS.stream().map(a -> actions.getOrDefault(a, null))
.filter(Objects::nonNull).collect(Collectors.toList());
Expand All @@ -170,9 +162,6 @@ public String getNextActionName(String currentActionName, Phase phase) {
case COLD_PHASE:
orderedActionNames = ORDERED_VALID_COLD_ACTIONS;
break;
case FROZEN_PHASE:
orderedActionNames = ORDERED_VALID_FROZEN_ACTIONS;
break;
case DELETE_PHASE:
orderedActionNames = ORDERED_VALID_DELETE_ACTIONS;
break;
Expand Down
Loading

0 comments on commit a0ec343

Please sign in to comment.