Commit Graph

224 Commits

Author SHA1 Message Date
debadair 12dda6fb36
[DOCS] Add ILM error/troubleshooting info. Closes #75849 (#76957)
* [DOCS] Add ILM error/troubleshooting info. Closes #75849

* Apply suggestions from code review

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

* Updated xref & fixed whitespace issues

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-08-26 15:44:50 -04:00
Keith Massey 0aab3c01c9
Ensuring that the ShrinkAction does not hang if total shards per node is too low (#76732)
We added configuration to AllocateAction to set the total shards per node property on the index. This makes it possible that a user could set this to a value lower than the total number of shards in the index that is about to be shrunk, meaning that all of the shards could not be moved to a single node in the ShrinkAction. This commit unsets the total shards per node property so that we fall back to the default value (-1, unlimited) in the ShrinkAction to avoid this.
Relates to #44070
2021-08-20 09:41:19 -05:00
Keith Massey 8610db674a
Allow for setting the total shards per node in the Allocate ILM action (#76134)
This adds a new optional field to the allocate ILM action called "total_shards_per_node". If present, the
value of this field is set as the value of "index.routing.allocation.total_shards_per_node" before the allocation
takes place.
Relates to #44070
2021-08-11 16:35:46 -05:00
Lee Hinman 3d5843a236
Allow ILM move-to-step without `action` or `name` (#75435)
* Allow ILM move-to-step without `action` or `name`

This commit enhances ILM's move-to-step API to allow dropping the `name`, or dropping both the
`action` and `name`. For example:

```json
POST /_ilm/move/foo-1
{
  "current_step": {
    "phase": "hot",
    "action": "rollover",
    "name": "check-rollover-ready"
  },
  "next_step": {
    "phase": "warm",
    "action": "forcemerge"
  }
}
```

Will move to the first step in the `forcemerge` action in the `warm` phase (without having to know
the specific step name).

Another example:

```json
POST /_ilm/move/foo-1
{
  "current_step": {
    "phase": "hot",
    "action": "rollover",
    "name": "check-rollover-ready"
  },
  "next_step": {
    "phase": "warm"
  }
}
```

Will move to the first step in the `warm` phase (without having to know the specific action name).

Bear in mind that the execution order is still entirely an implementation detail, so "first" in the
above sentences means the first step that ILM would execute.

Resolves #58128

* Apply Andrei's wording change (thanks!)

Co-authored-by: Andrei Dan <andrei.dan@elastic.co>

* Log index and policy name when the concrete step key can't be resolved

Co-authored-by: Andrei Dan <andrei.dan@elastic.co>
2021-07-19 12:10:25 -04:00
Stef Nestor fdcb9c3247
[DOCS] Note ILM `searchable_snapshot` action requires data tiers (#74706) 2021-06-30 11:03:11 -04:00
Andrei Dan 5e9405a513
[DOCS]: allow multiple searchable_snapshot actions in the same policy (#74679)
Since `7.12` we allow multiple searchable_snapshot actions in the same
policy. This updates the docs to reflect this.
2021-06-29 14:20:26 +01:00
Andrei Dan 5ca240eabd
Add `dry_run` support to the migrate to data tiers API (#74639)
This adds support for a `dry_run` parameter for the
`_ilm/migrate_to_data_tiers` API. This defaults to `false`, but when
configured to `true` it will simulate the migration of elasticsearch
entities to data tiers based routing, returning the entites that need to
be updated (indices, ILM policies and the legacy index template that'd
be deleted, if any was configured in the request).
2021-06-29 10:37:16 +01:00
James Rodewig 0c205b0d68
[DOCS] Document how to switch ILM policies (#73967)
To switch an index's lifecycle policy, you must first remove the existing
policy. Otherwise, phase execution for the index may silently fail.

Closes #70151
2021-06-28 10:32:01 -04:00
Andrei Dan 636aa7c0da
Add migrate to data tiers API (#74264)
This adds the _ilm/migrate_to_data_tiers API to expose the service for
migrating the elasticsearch abstractions (indices, ILM policies and an 
optional legacy template to delete) to data tiers routing allocation 
(away from custom node attributes)
2021-06-28 12:07:39 +01:00
James Rodewig 2fe07014d9
[DOCS] Move ES glossary to Stack docs (#74579)
The ES glossary is now incorporated into the [Elastic glossary](https://www.elastic.co/guide/en/elastic-stack-glossary/current/terms.html).

Depends on https://github.com/elastic/stack-docs/pull/1722 and https://github.com/elastic/docs/pull/2141
2021-06-24 19:04:31 -04:00
Lee Hinman 997db17852
Add usage to get ILM policy response (#74518)
This commit adds the "in_use_by" object to the response for ILM policies. This map shows the
indices, data streams, and composable templates that use the ILM policy.

An example output may look like:

```json
{
  "logs" : {
    "version" : 1,
    "modified_date" : "2021-06-23T18:42:08.381Z",
    "policy" : {
      ...
    },
    "in_use_by" : {
      "indices" : [".ds-logs-foo-barbaz-2021.06.23-000001", ".ds-logs-foo-other-2021.06.23-000001"],
      "data_streams" : ["logs-foo-barbaz", "logs-foo-other"],
      "composable_templates" : ["logs"]
    }
  }
}
```

Resolves #73869
2021-06-23 16:01:19 -06:00
Stef Nestor 8b8466b42c
[DOCS] Fix ILM action order (#74021)
Following [this code](https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleType.java#L54) I believe these are the necessary changes to bring the doc into alignment.

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-06-10 14:28:44 -04:00
Stef Nestor fc1ea9c317
[DOCS] Fix `operation_mode` response property def (#73976) 2021-06-10 13:31:15 -04:00
bellengao b6fd1bbb06
Add _meta field to ilm policy (#73515)
Relates to #70755.

The main changes of this PR are:

    Add an optional _meta field to ILM policy.
    Add some test code about the change.
    Update the doc of Create or update lifecycle policy API.
2021-06-01 11:17:53 -06:00
James Rodewig 5729bb8d49
[DOCS] Update alias references (#73427)
Updates several `index aliases` references to `aliases`.
2021-05-27 16:00:57 -04:00
James Rodewig 39a0314d30
[DOCS] Update alias xrefs (#73380)
Updates several internal 'alias' xrefs to point to the aliases guide rather than
API docs.
2021-05-25 16:19:00 -04:00
Andrei Dan 6a38aff777
[DOCS] Clarify that at least one met condition triggers rollover (#73224) 2021-05-24 19:15:16 +01:00
James Rodewig c9223a25a4
[DOCS] Update anchor for alias write index (#73108)
Updates the anchor for our alias write index content. Changes are no-op, but this helps prepare for future work on alias docs.
2021-05-14 12:35:25 -04:00
James Rodewig 8dddca77aa
[DOCS] Remove and redirect frozen index overview content (#72990)
Changes:

* Removes and adds redirects for the frozen indices [overview][0], [best
  practices][1], [search][2], and [monitoring][3] pages.
* Removes glossary terms related to frozen indices.
* Updates several xrefs to point to the freeze index API docs.

Relates to elastic/elasticsearch#72946 and elastic/elasticsearch#70192.

[0]: https://www.elastic.co/guide/en/elasticsearch/reference/7.12/frozen-indices.html
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/master/best_practices.html
[2]: https://www.elastic.co/guide/en/elasticsearch/reference/master/searching_a_frozen_index.html
[3]: https://www.elastic.co/guide/en/elasticsearch/reference/master/monitoring_frozen_indices.html
2021-05-12 12:54:20 -04:00
James Rodewig dbad9d0a0d
[DOCS] Update 'shared_cache' references for searchable snapshots (#72775) 2021-05-05 17:49:15 -04:00
debadair 633e1322f1
[DOCS] How to migrate to node roles from node attrs. Closes #65855 (#71160)
* [DOCS] Document how to migrate to node roles from node attrs. Closes #65855

* [DOCS] Incorporated review comments

* Update docs/reference/data-management/migrate-index-allocation-filters.asciidoc

Co-authored-by: Andrei Dan <andrei.dan@elastic.co>
2021-04-27 14:39:54 -07:00
Frederic Dartayre b50525af3f
Update ilm-skip-rollover.asciidoc 2021-04-19 15:57:49 +02:00
Andrei Dan b2639d700a
DOCS: update `delete_searchable_snapshot` option documentation (#71547)
If enabled, the `delete_searchable_snapshot` option will attempt to delete the
index snapshot generated in any previous phase, for the purpose of mounting the
index as a searchable snapshot.
2021-04-13 11:25:15 +01:00
James Rodewig 65be40ac7b
[DOCS] Refactor rollover API docs (#70938) 2021-04-06 11:51:02 -04:00
James Rodewig 9ab1a6caa3
[DOCS] Fix put lifecycle policy API title (#71124) 2021-03-31 11:37:45 -04:00
James Rodewig 693807a6d3
[DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
James Rodewig 955df4337b
[DOCS] Fix typos for Elasticsearch Service and Elastic Agent (#71076) 2021-03-31 08:36:21 -04:00
James Rodewig 493741dd7f
[DOCS] Remove docs for rollup refactor (#70885) 2021-03-26 09:03:00 -04:00
James Rodewig cfe13a843e
[DOCS] Fix heading for ILM shrink example (#70733) 2021-03-23 11:07:02 -04:00
Henning Andersen 9002bd81a1
[DOCS] Frozen tier dedicated (#70542)
The frozen tier is now dedicated for searchable snapshots mounted with
the `shared_cache` option. This commit adjusts docs accordingly.
2021-03-19 11:16:41 +01:00
Andrei Dan 9831084067
ILM: Make all the shrink action steps retryable (#70107)
This aims at making the shrink action retryable. Every step is
retryable, but in order to provide an experience where ILM tries
to achieve a successful shrink even when the target node goes
missing permanently or the shrunk index cannot recover, this also
introduces a retryable shrink cycle within the shrink action.

The shrink action will generate a unique index name that'll be the
shrunk index name. The generated index name is stored in the lifecycle
state.

If the shrink action ends up waiting for the source shards to
colocate or for the shrunk index to recover for more than the configured
`LIFECYCLE_STEP_WAIT_TIME_THRESHOLD` setting, it will move back
to clean up the attempted (and failed) shrunk index and will retry
generating a new index name and attempting to shrink the source
to the newly generated index name.
2021-03-18 16:05:15 +00:00
James Rodewig 5c75d004fa
[DOCS] Replace `put` with `create or update` in API names (#70330)
Co-authored-by: debadair <debadair@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-03-15 14:49:44 -04:00
Lee Hinman 67f13bb679
Restrict ILM frozen phase to searchable snapshot actions only (#70158)
This commit changes the frozen phase within ILM in the following ways:

- The `searchable_snapshot` action now no longer takes a `storage` parameter. The storage type is
determined by the phase within which it is invoked (shared cache for frozen and full copy for
everything else).
- The frozen phase in ILM now no longer allows *any* actions other than `searchable_snapshot`
- If a frozen phase is provided, it *must* include a `searchable_snapshot` action.

These changes may seem breaking, but since they are intended to go back to 7.12 which has not been
released yet, they are not truly breaking changes.
2021-03-09 11:24:04 -07:00
Lee Hinman 5df763fc66
Reject creating ILM policies with phase timings are not >= previous phase (#70089)
It can be confusing to configure policies with phase timings that get smaller, because phase timings
are absolute. To make things a little clearer, this commit now rejects policies where a configured
min_age is less than a previous phase's min_age.

This validation is added only to the PutLifecycleAction.Request instead of the
TimeseriesLifecycleType class because we cannot do this validation every time a lifecycle is
created or else we will block cluster state from being recoverable for existing clusters that may
have invalid policies.

Resolves #70032
2021-03-08 12:40:20 -07:00
Joe Gallo f93242a5f9
Switch built-in policies to max_primary_shard_size (#69995) 2021-03-04 17:00:45 -05:00
Tal Levy c1c5103756
Generate random rollup index names for RollupILMAction (#69237)
This commit moves away from the static `rollup-{indexName}` rollup index
naming strategy and moves towards a randomized rollup index name scheme.

This will reduce the complications that exist if the RollupStep fails and retries
in any way. A separate cleanup will still be required for failed temporary indices,
but at least there will not be a conflict.

This commit generates the new rollup index name in the LifecycleExecutionState so
that it can be used in RollupStep and UpdateRollupIndexPolicyStep on a per-index
basis.
2021-02-24 12:31:36 -08:00
James Rodewig 0cbab23e80
[DOCS] Update ILM tutorial docs for UI changes (#69189) 2021-02-19 12:56:58 -05:00
Joe Gallo 7e7c5db74e
Rename max_single_primary_size to max_primary_shard_size (#69239) 2021-02-18 21:13:58 -05:00
Andrei Dan 4bf09f66d8
[DOCS] Remove beta label from searchable_snapshot ILM action docs (#69196)
Searchable snapshots are GA since 7.11

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-02-18 16:06:09 +00:00
Joe Gallo d24f5cbc91
Add max_single_primary_size as a condition for the ILM rollover action (#68917) 2021-02-18 09:28:58 -05:00
James Rodewig 9b88ae92e6
[DOCS] Fix typos for duplicate words (#69125) 2021-02-17 10:34:20 -05:00
Andrei Dan 9da3a6ee8d
ILM: enable the readonly action in the cold phase (#69024)
This enables the readonly ILM action in the cold phase.
2021-02-16 11:56:39 +00:00
Andrei Dan 800ae518f4
ILM: searchable snapshot executes before migrate in cold/frozen (#68861)
This moves the execution of the `searchable_snapshot` action before the
`migrate` action in the `cold` and `frozen` phases for more efficient
data migration (ie. mounting it as a searchable snapshot directly on the
target tier)

Now that searchable_snapshot can precede other actions in the same phase
(eg. in frozen it is followed by `migrate`) we need to allow the mounted
index to resume executing the ILM policy starting with a step that's part
of a new action (ie. migrate).

This adds support to resume the execution of the mounted index from another
action.

With older versions, the execution would resume from the PhaseCompleteStep
as it was the last action in a phase, which was handled as a special case
in the `CopyExecutionStateStep`. This  generalises the `CopyExecutionStateStep`
to be able to resume from any `StepKey`.
2021-02-15 09:35:11 +00:00
Lee Hinman e552fd7ce6
Add support for partial searchable snapshots to ILM (#68714)
This commit adds support for the recently introduced partial searchable snapshot (#68509) to ILM.

Searchable snapshot ILM actions may now be specified with a `storage` option, specifying either
`full_copy` or `shared_cache` (similar to the "mount" API) to mount either a full or partial
searchable snapshot:

```json
PUT _ilm/policy/my_policy
{
  "policy": {
    "phases": {
      "cold": {
        "actions": {
          "searchable_snapshot" : {
            "snapshot_repository" : "backing_repo",
            "storage": "shared_cache"
          }
        }
      }
    }
  }
}
```

Internally, If more than one searchable snapshot action is specified (for example, a full searchable
snapshot in the "cold" phase and a partial searchable snapshot in the "frozen" phase) ILM will
re-use the existing snapshot when doing the second mount since a second snapshot is not required.

Currently this is allowed for actions that use the same repository, however, multiple
`searchable_snapshot` actions for the same index that use different repositories is not allowed (the
ERROR state is entered). We plan to allow this in the future in subsequent work.

If the `storage` option is not specified in the `searchable_snapshot` action, the mount type
defaults to "shared_cache" in the frozen phase and "full_copy" in all other phases.

Relates to #68605
2021-02-09 09:14:19 -07:00
James Rodewig adadf47819
[DOCS] Reuse ILM rollup action config (#68755) 2021-02-09 10:50:30 -05:00
Lee Hinman 3f9f007545
Add the frozen tier node role and ILM phase (#68605)
This commit adds the `data_frozen` node role as part of the formalization of data tiers. It also
adds the `"frozen"` phase to ILM, currently allowing the same actions as the existing cold phase.

The frozen phase is intended to be used for data even less frequently searched than the cold phase,
and will eventually be loosely tied to data using partial searchable snapshots (as oppposed to full
searchable snapshots in the cold phase).

Relates to #60848
2021-02-05 14:38:13 -07:00
James Rodewig 5695a63f0c
[DOCS] Minor layout and syntax fixes (#68589) 2021-02-05 12:06:04 -05:00
James Rodewig 36d4c12b92
[DOCS] Update ILM screenshots and tutorial (#68482)
Changes:

- Reworks the ILM tutorial to focus on the Elastic Agent and a built-in ILM policy
- Updates several screenshots in the docs for the new ILM UI

Co-authored-by: debadair <debadair@elastic.co>
2021-02-05 08:57:37 -05:00
Adam Locke 5d72d46ceb
[DOCS] Updating ILM phase language (#68477) 2021-02-03 14:52:38 -05:00
bellengao d69c03359f
Support max_single_primary_size in Resize Action and exposed in ILM (#67705) 2021-01-29 15:29:45 -05:00