Commit graph

8263 commits

Author SHA1 Message Date
David Turner
8abc3fb796
Fix docs for behaviour of CCR after lease expiry (#69114)
Today we imply that CCR will automatically fall back to a full index
copy if it cannot replay any missing history. This was true for earlier
versions of the design but we ultimately decided not to do this without
adjusting the docs to match. This commit fixes the docs.
2021-02-17 13:26:48 +00:00
Lisa Cawley
a1fb2c3606
[DOCS] Fixes n_gram_encoding in data frame analytics APIs (#69084) 2021-02-16 14:02:00 -08:00
Luca Cavanna
bd3467a305
Add the ability to remove a runtime field (#68992)
Currently, existing runtime fields can be updated, but they cannot be removed. That allows to correct potential mistakes, but once a runtime field is added to the index mappings, it is not possible to remove it.

With this commit we introduce the ability to remove an existing runtime field by providing a null value for it through the put mapping API. If a field with such name does not exist, such specific instruction will have no effect on other existing runtime fields.

Note that the removal of runtime fields makes the recently introduced assertRefreshItNotNeeded assertion trip, because when each local node merges mappings back in, the runtime fields that were previously removed by the master node, get added back again locally. This is only a problem for the assertion that verifies that the removed refresh operation is never needed. We worked around this by tweaking the assertion to ignore runtime fields completely, for simplicity, by assertion on the serialized merged mappings and incoming mappings without the corresponding runtime section.

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2021-02-16 21:00:16 +01:00
James Rodewig
5eb0a9528a
[DOCS] EQL: Document like and regex keywords (#68932) (#69052) 2021-02-16 11:34:03 -05:00
James Rodewig
14ea0072e9
[DOCS] Update priority recommendation for index templates (#69006) 2021-02-16 10:53:28 -05:00
James Rodewig
8f582c1cd7
[DOCS] Add EQL glossary def (#68938) 2021-02-16 10:17:57 -05:00
David Turner
92d13a3f7d
Introduce repository test kit/analyser (#67247)
Today we rely on blob stores behaving in a certain way so that they can be used
as a snapshot repository. There are an increasing number of third-party blob
stores that claim to be S3-compatible, but which may not offer a suitably
correct or performant implementation of the S3 API. We rely on somesubtle
semantics with concurrent readers and writers, but some blob stores may not
implement it correctly. Hitting a corner case in the implementation may be rare
in normal use, and may be hard to reproduce or to distinguish from an
Elasticsearch bug.

This commit introduces a new `POST /_snapshot/.../_analyse` API which exercises
the more problematic corners of the repository implementation looking for
correctness bugs and measures the details of the performance of the repository
under concurrent load.
2021-02-16 14:24:40 +00: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
Jim Ferenczi
f67185f746
Add a cluster privilege to cancel tasks and delete async searches (#68679)
This change adds a new cluster privilege cancel_task that allows to:

Cancel running tasks (_tasks/_cancel).
Cancel and delete async searches.
Today the 'manage' cluster privilege is required to cancel tasks and
to delete async searches when security features are enabled.
This new focused privilege allows to handle tasks and searches only.

The change also adds the privilege to the internal 'kibana_system'
and '_async_search' roles. They both need to be able to cancel tasks
and delete async searches.

Relates #67965
2021-02-16 10:56:17 +01:00
Marios Trivyzas
f9af60bf69
Add query param to limit highlighting to specified length (#67325)
Add a `max_analyzed_offset` query parameter to allow users
to limit the highlighting of text fields to a value less than or equal to the
`index.highlight.max_analyzed_offset`, thus avoiding an exception when
the length of the text field exceeds the limit. The highlighting still takes place,
but stops at the length defined by the new parameter.

Closes: #52155
2021-02-16 09:25:45 +01: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
Lisa Cawley
8b6ec07613
[DOCS] Edits ML hyperparameter descriptions (#68880) 2021-02-11 11:55:28 -08:00
Gordon Brown
3f6472de74
Introduce "Feature States" for managing snapshots of system indices (#63513)
This PR expands the meaning of `include_global_state` for snapshots to include system indices. If `include_global_state` is `true` on creation, system indices will be included in the snapshot regardless of the contents of the `indices` field. If `include_global_state` is `true` on restoration, system indices will be restored (if included in the snapshot), regardless of the contents of the `indices` field. Index renaming is not applied to system indices, as system indices rely on their names matching certain patterns. If restored system indices are already present, they are automatically deleted prior to restoration from the snapshot to avoid conflicts.

This behavior can be overridden to an extent by including a new field in the snapshot creation or restoration call, `feature_states`, which contains an array of strings indicating the "feature" for which system indices should be snapshotted or restored. For example, this call will only restore the `watcher` and `security` system indices (in addition to `index_1`):

```
POST /_snapshot/my_repository/snapshot_2/_restore
{
  "indices": "index_1",
  "include_global_state": true,
  "feature_states": ["watcher", "security"]
}
```

If `feature_states` is present, the system indices associated with those features will be snapshotted or restored regardless of the value of `include_global_state`. All system indices can be omitted by providing a special value of `none` (`"feature_states": ["none"]`), or included by omitting the field or explicitly providing an empty array (`"feature_states": []`), similar to the `indices` field.

The list of currently available features can be retrieved via a new "Get Snapshottable Features" API:
```
GET /_snapshottable_features
```

which returns a response of the form:
```
{
    "features": [
        {
            "name": "tasks",
            "description": "Manages task results"
        },
        {
            "name": "kibana",
            "description": "Manages Kibana configuration and reports"
        }
    ]
}
```

Features currently map one-to-one with `SystemIndexPlugin`s, but this should be considered an implementation detail. The Get Snapshottable Features API and snapshot creation rely upon all relevant plugins being installed on the master node.

Further, the list of feature states included in a given snapshot is exposed by the Get Snapshot API, which now includes a new field, `feature_states`, which contains a list of the feature states and their associated system indices which are included in the snapshot. All system indices in feature states are also included in the `indices` array for backwards compatibility, although explicitly requesting system indices included in a feature state is deprecated. For example, an excerpt from the Get Snapshot API showing `feature_states`:
```
"feature_states": [
    {
        "feature_name": "tasks",
        "indices": [
            ".tasks"
        ]
    }
],
"indices": [
    ".tasks",
    "test1",
    "test2"
]
```

Co-authored-by: William Brafford <william.brafford@elastic.co>
2021-02-11 11:55:14 -07:00
James Rodewig
293fcd4c41
[DOCS] EQL: Minor doc fixes (#68927) 2021-02-11 13:44:01 -05:00
Christoph Büscher
3f267ad659
Add runtime field section to Field Capabilities API (#68904)
Currently runtime fields from search requests don't appear in the output of the
field capabilities API, but some consumer of runtime fields would like to see
runtime section just like they are defined in search requests reflected and
merged into the field capabilities output.
This change adds parsing of a "runtime_mappings" section equivallent to the one
on search requests to the `_field_caps` endpoint, passes this section down to
the shard level where any runtime fields defined here overwrite the mapping of
the targetet indices.

Closes #68117
2021-02-11 16:20:18 +01:00
István Zoltán Szabó
742facdfe6
[DOCS] Adds runtime filed related item to Transforms limitations (#68895) 2021-02-11 16:09:26 +01:00
Mayya Sharipova
6521d2af27
Introduce eql search status API (#68065)
Introduce eql search status API,
that reports the status of eql stored or async search.

GET _eql/search/status/<id>

The API is restricted to the monitoring_user role.

For a running eql search, a response has the following format:

{
  "id" : <id>,
  "is_running" : true,
  "is_partial" : true,
  "start_time_in_millis" : 1611690235000,
  "expiration_time_in_millis" : 1611690295000
}

For a completed eql search, a response has the following format:

{
  "id" : <id>,
  "is_running" : false,
  "is_partial" : false,
  "expiration_time_in_millis" : 1611690295000,
  "completion_status" : 200
}

Closes #66955
2021-02-11 09:30:13 -05:00
Igor Motov
0bbc6addd9
Revert "Remove aggregation's postCollect phase (#68615)
This partially reverts #64016 and  and adds #67839 and adds
additional tests that would have caught issues with the changes
in #64016. It's mostly Nik's code, I am just cleaning things up
a bit.

Co-authored-by: Nik Everett <nik9000@gmail.com>
2021-02-10 19:12:50 -05:00
Lisa Cawley
683368cc4d
[DOCS] Clarify soft_tree_depth_limit (#68787)
Co-authored-by: Tom Veasey <tveasey@users.noreply.github.com>
2021-02-10 12:51:01 -08:00
James Rodewig
babf3eb081
[DOCS] EQL: Remove duplicate case-sensitivity info (#68860) 2021-02-10 14:27:29 -05:00
Marios Trivyzas
45677a385b
QL: Eliminate internal type DATETIME_NANOS (#68220)
Moving towards grouping of data types in the field caps API
the internal data type `DATETIME_NANOS` introduced for `date_nanos`
support is eliminated.

Relates: #67722
Follows: #67666
2021-02-10 18:15:54 +01:00
Andrei Stefan
ee5cc5442a
QL: "fields" api implementation in QL (#68802)
* Integrate "fields" API into QL (#68467)
* QL: retry SQL and EQL requests in a mixed-node (rolling upgrade) cluster (#68602)
* Adapt nested fields extraction from "fields" API output to the new un-flattened structure (#68745)
2021-02-10 11:17:10 +02:00
James Rodewig
c65615911f
[DOCS] Expand simple query string query's multi-position token section (#68753) 2021-02-09 16:07:02 -05:00
Christoph Büscher
8fff763148
[Docs] Add nested fields handling in fields API (#68657)
This change adds a paragraph on the different response format for nested fields
in the fields API and adds an example snippet.

Related to #63709
2021-02-09 18:09:58 +01:00
Adam Locke
a39eef6309
[DOCS] Fixing Painless tests (#68157)
* Fixing Painless tests.

* Update runtime field context to fix test cases.

* Remove watcher logging from usage API and replace test.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-02-09 11:24:14 -05: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
David Turner
71763ca37f
Add docs on repository reliability and backups (#68740)
This commit spells out how important repository reliability is to
searchable snapshots, and also documents a procedure for taking a backup
of a snapshot repository.

Relates #54944
2021-02-09 14:57:06 +00:00
Dan Hermann
761b8aba8e
[DOCS] Fingerprint ingest processor (#68610) 2021-02-09 06:19:21 -06:00
Ignacio Vera
f58d7854c5
Deprecate GeoPolygon query in favour of GeoShape query. (#64227) 2021-02-09 10:21:18 +01:00
Yannick Welsch
e97f233fbe
Remove beta label from searchable snapshot docs (#68724)
This feature will go GA in 7.11.
2021-02-09 09:28:03 +01:00
István Zoltán Szabó
4443cb2f0e
[DOCS] Adds retention_policy to PUT Transform API docs (#68656)
Co-authored-by: lcawl <lcawley@elastic.co>
2021-02-09 08:00:47 +01:00
James Rodewig
5f3542a28e
[DOCS] Add data_frozen role to node docs (#68713) 2021-02-08 17:43:47 -05:00
James Rodewig
c8fd4c5460
[DOCS] Add collapsible sections to multi search API docs (#68695)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-02-08 13:37:21 -05:00
James Rodewig
b428743f02
[DOCS] Fix caps for search template API docs (#68696) 2021-02-08 13:24:02 -05:00
bellengao
4950bc4969
[DOCS] Format the multi search api doc (#68621) 2021-02-08 12:28:31 -05:00
James Rodewig
e0935f658f
[DOCS] Note rollup metrics cannot be used in histogram (#68675) 2021-02-08 11:41:38 -05:00
Hendrik Muhs
54ed2e37d9
[Transform] implement retention policy to delete data from a transform (#67832)
add a retention policy to transform to delete data that is considered outdated as part of a
transform checkpoint.

fixes #67916
2021-02-08 15:06:15 +01:00
James Rodewig
0f5af55258
[DOCS] Update example request description (#68587) (#68658)
The doc is misleading : The following intervals search returns documents containing `my favorite food` **immediately** followed by `hot water` or `cold porridge`

max_gaps apply only to the match query and is not used for checking proximity with the other match, the example given actually`This search would match a my_text value of my favorite food is cold`

Co-authored-by: Julien Guay <guay_j@yahoo.fr>
2021-02-08 08:50:56 -05:00
István Zoltán Szabó
05e16428fe
[DOCS] Expands transforms docs with persistent tasks and related links. (#68582) 2021-02-08 09:44:06 +01: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
Andras Palinkas
a3dbdae2ef
SQL: Test and fix the NULL handling of the String functions (#68379)
Fixed the inconsistencies regarding NULL argument handling.
NULL literal vs NULL field value as function arguments in some case
resulted in different function return values.

Functions should return with the same value no matter if the argument(s)
came from a field or from a literal.

The introduced integration test tests if function calls with same
argument values (regardless of literal/field) will return with the
same output (also checks if newly added functions are added to the
testcases).

Fixed the following functions:
* Insert: NULL start, length and replacement arguments (as fields) also
result in NULL return value instead of returning the input.
* Locate: NULL pattern results in NULL return value, NULL optional start
argument handled the same as missing start argument
* Replace: NULL pattern and replacement results in NULL instead of
returning the input
* Substring: NULL start or length results in NULL instead of returning
the input

Fixes #58907
2021-02-05 12:30:37 -05: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
Yannick Welsch
50f4a0b77c
Add partial searchable snapshot support for a frozen tier (#68509)
A frozen tier is backed by an external object store (like S3) and caches only a
small portion of data on local disks. In this way, users can reduce hardware
costs substantially for infrequently accessed data. For the frozen tier we only
pull in the parts of the files that are actually needed to run a given search.
Further, we don't require the node to have enough space to host all the files.
We therefore have a cache that manages which file parts are available, and which
ones not. This node-level shared cache is bounded in size (typically in relation
to the disk size), and will evict items based on a LFU policy, as we expect some
parts of the Lucene files to be used more frequently than other parts. The level
of granularity for evictions is at the level of regions of a file, and does not
require evicting full files. The on-disk representation that was chosen for the
cold tier is not a good fit here, as it won't allow evicting parts of a file.
Instead we are using fixed-size pre-allocated files and have implemented our own
memory management logic to map regions of the shard's original Lucene files onto
regions in these node-level shared files that are representing the on-disk
cache.

This PR adds the core functionality to searchable snapshots to power such a
frozen tier:
- It adds the node-level shared cache that evicts file regions based on a LFU
  policy
- It adds the machinery to dynamically download file regions into this cache and
  serve their contents when searches execute.
- It extends the mount API with a new parameter, `storage`, which selects the
  kind of local storage used to accelerate searches of the mounted index. If set
  to `full_copy` (default, used for cold tier), each node holding a shard of the
  searchable snapshot index makes a full copy of the shard to its local storage.
  If set to `shared_cache`, the shard uses the newly introduced shared cache,
  only holding a partial copy of the index on disk (used for frozen tier).

Co-authored-by: Tanguy Leroux <tlrx.dev@gmail.com>
Co-authored-by: Armin Braun <me@obrown.io>
Co-authored-by: David Turner <david.turner@elastic.co>
2021-02-05 09:15:07 +01:00
debadair
2c726cb981
[DOCS] Removed license level information. (#68568) 2021-02-04 18:04:09 -08:00
debadair
ba45251833
[DOCS] Update package description. (#68565)
* [DOCS] Update package description.

* Fixed xref
2021-02-04 16:47:12 -08:00
James Rodewig
bc0d37dffa
[DOCS] Document what makes a geo-point malformed (#59045) (#68556)
Co-authored-by: Ben Moskovitz <ben@mosk.nz>
2021-02-04 17:01:59 -05:00
James Rodewig
ab0f4d51b2
[DOCS] Add missing newline for bulleted list in top_metrics docs (#68481) (#68550)
Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
2021-02-04 14:49:02 -05:00
James Rodewig
6378c57ca0
[DOCS] EQL: Add filter_path param to EQL search API docs (#68537) 2021-02-04 13:39:01 -05:00