Commit graph

89 commits

Author SHA1 Message Date
Nick Canzoneri
2b268d359d
[docs] Update search-settings documentation to reflect the fact that the indices.query.bool.max_clause_count setting has been deprecated (#91811)
* Update search-settings documentation to reflect the fact that the indices.query.bool.max_clause_count setting has been deprecated

* Fix indentation

* Replace Elasticsearch with {es}

* Add deprecation entry to release notes

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2022-11-29 18:10:30 +01:00
Paramdeep Singh
34ff7a9d98
Consolidated Circuit Breaker documentation to include EQL and ML infer (#90809)
Fixes #85851 

Co-authored-by: Iraklis Psaroudakis <kingherc@gmail.com>
2022-10-14 14:33:52 +03:00
Luca Cavanna
18942d5b11
Enhance nested depth tracking when parsing queries (#90425)
When parsing queries on the coordinating node, there is currently no way to share state between the different parsing methods (`fromXContent`). The only query that supports a parse context is bool query, which uses the context to track nested depth of queries, added with #66204. Such nested depth tracking mechanism is not 100% accurate as it tracks bool queries only, while there's many more query types that can hold other queries hence potentially cause stack overflow when deeply nested.

This change removes the parsing context that's specific to bool query, introduced with #66204, in favour of generalizing the nested depth tracking to all query types.

The generic tracking is introduced by wrapping the parser and overriding the method that parses named objects through the xcontent registry. Another way would have been to require a context argument when parsing queries, which would mean adding a context argument to all the QueryBuilder#fromXContent static methods. That would be a breaking change for plugins that provide custom queries, hence I went for trying out a different approach.

One aspect that this change requires and introduces is the distinction between parsing a top level query (which will wrap the parser, or it would create the context if we had one), as opposed to parsing an inner query, which goes ahead with the given parser and context. We already have this distinction as we have two different static methods in `AbstractQueryBuilder` but in practice only bool query makes the distinction being the only context-aware query.

In addition to generalizing tracking nested depth when parsing queries, we should be able to adopt this same strategy to track queries usage as part #90176 .

Given that the depth check is now more restrictive, as it counts all compound queries and not only bool, we have decided to raise the default limit to `30` to ensure that users are not going to hit the limit due to this change.
2022-10-12 15:15:06 +02:00
Leaf-Lin
65b05f858e
Add default value for destructive_requires_name (#85591)
As per https://github.com/elastic/elasticsearch/pull/66908, the setting now defaults to `True`, but it's not shown in the doc.  Can we please have the doc updated?
2022-08-25 08:44:53 -04:00
Tanguy Leroux
7f827bbab8
Document and test operator-only node bandwidth recovery settings (#83372)
This commit updates the Operator-only functionality doc to 
mention the operator only settings introduced in #82819.

It also adds an integration test for those operator only 
settings that would have caught #83359.
2022-02-02 11:50:19 +01:00
David Turner
a062bdf42f
Add docs for node bandwith settings (#83361)
Relates #82819
2022-02-01 12:19:00 +00:00
erictung1999
58ffc42f5f
[DOCS] Fix typo (#82100)
Fix typo under `indices.recovery.max_concurrent_snapshot_file_downloads_per_node`
2022-01-13 09:42:22 -05:00
Stuart Tettemer
30e15ba838
Script: Time series compile and cache evict metrics (#79078)
Collects compilation and cache eviction metrics for
each script context.

Metrics are available in _nodes/stats in 5m/15m/1d
buckets.

Refs: #62899
2021-11-03 13:13:42 -05:00
Stuart Tettemer
808b70d2f9
Script: Restore the scripting general cache (#79453)
Deprecate the script context cache in favor of the general cache.

Users should use the following settings:
`script.max_compilations_rate` to set the max compilation rate
  for user scripts such as filter scripts.  Certain script contexts
  that submit scripts outside of the control of the user are
  exempted from this rate limit.  Examples include runtime fields,
  ingest and watcher.

`script.cache.max_size` to set the max size of the cache.

`script.cache.expire` to set the expiration time for entries in
the cache.

Whats deprecated?
`script.max_compilations_rate: use-context`.  This special
setting value was used to turn on the script context-specific caches.

`script.context.$CONTEXT.cache_max_size`, use `script.cache.max_size`
instead.

`script.context.$CONTEXT.cache_expire`, use `script.cache.expire`
instead.

`script.context.$CONTEXT.max_compilations_rate`, use
`script.max_compilations_rate` instead.

The default cache size was increased from `100` to `3000`, which
was approximately the max cache size when using context-specific caches.

The default compilation rate limit was increased from `75/5m` to
`150/5m` to account for increasing uses of scripts.

System script contexts can now opt-out of compilation rate limiting
using a flag rather than a sentinel rate limit value.

7.16: Script: Deprecate script context cache #79508
Refs: #62899

7.16: Script: Opt-out system contexts from script compilation rate limit #79459
Refs: #62899
2021-10-21 07:57:27 -05:00
Francisco Fernández Castaño
2b4fe8fc7b
Limit concurrent snapshot file restores in recovery per node (#79316)
Today we limit the max number of concurrent snapshot file restores
per recovery. This works well when the default
node_concurrent_recoveries is used (which is 2). When this limit is
increased, it is possible to exhaust the underlying repository
connection pool, affecting other workloads.

This commit adds a new setting
`indices.recovery.max_concurrent_snapshot_file_downloads_per_node` that
allows to limit the max number of snapshot file downloads per node
during recoveries. When a recovery starts in the target node it tries
to acquire a permit that allows it to download snapshot files when it is
granted. This is communicated to the source node in the
StartRecoveryRequest. This is a rather conservative approach since it is
possible that a recovery that gets a permit to use snapshot files
doesn't recover any snapshot file while there's a concurrent recovery
that doesn't get a permit could take advantage of recovering from a
snapshot.

Closes #79044
2021-10-18 18:17:27 +02:00
Adam Locke
c3b67ee0ae
[DOCS] Fix default value for closed indices (#78924)
* [DOCS] Fix default value for closed indices

#57953 introduced changes that added ESS icons to many Elasticsearch settings. As part of those changes, the default value for `cluster.indices.close.enable` was indicated as `false`, when it should be `true`. This PR updates the default value to `true`. 

Closes #78877

* Update description

* Update note to remove outdated claims
2021-10-13 08:14:01 -04:00
Samuel Nelson
c4f5d41fe7
[DOCS] Update ESS support for stack.templates.enabled (#78732)
The documentation indicates that `stack.templates.enabled` can be used in Elasticsearch Service, but it is not part of the settings allowlist in ESS. This PR makes the documentation match the state of the allowlist.
2021-10-06 09:37:30 -04:00
AndyHunt66
a5030ef407
[DOCS] Fix typo for script.painless.regex.enabled setting value (#77853)
The value is `limited`, not `limit`.
2021-09-16 13:59:58 -04:00
Johan Nilsson Hansen
553e8dcb07
Create a sha-256 hash of the shard request cache key (#74877)
We currently use the plaintext body of a shard request as the key to the 
request cache.  This has the disadvantage that very large requests can
quickly fill up the cache due to the size of their keys.  With this commit, 
we instead use a sha-256 hash of the shard request as the cache key, 
which will use a constant (and much smaller) number of bytes.
2021-09-13 08:55:59 +01:00
Francisco Fernández Castaño
2ebe5cd075
Add peer recoveries using snapshot files when possible (#76237)
This commit adds peer recoveries from snapshots. It allows establishing a replica by downloading file data from a snapshot rather than transferring the data from the primary. 

Enabling this feature is done on the repository definition. Repositories having the setting `use_for_peer_recovery=true` will be consulted to find a good snapshot when recovering a shard.

Relates #73496
2021-08-13 10:42:16 +02:00
Francisco Fernández Castaño
3c8b9a6f2e
Add peer recovery planners that take into account available snapshots (#75840)
This commit adds a new set of classes that would compute a peer
recovery plan, based on source files + target files + available
snapshots. When possible it would try to maximize the number of
files used from a snapshot. It uses repositories with `use_for_peer_recovery`
setting set to true.

It adds a new recovery setting `indices.recovery.use_snapshots`

Relates #73496
2021-08-09 14:03:12 +02:00
James Rodewig
5252995b48
[DOCS] Document regex circuit breaker (#76048)
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to #63029.

Closes #75199.
2021-08-04 16:37:29 -04:00
Adrien Grand
feb6620d14
indices.query.bool.max_clause_count now limits all query clauses (#75297)
In the upcoming Lucene 9 release, `indices.query.bool.max_clause_count` is
going to apply to the entire query tree rather than per `bool` query. In order
to avoid breaks, the limit has been bumped from 1024 to 4096.

The semantics will effectively change when we upgrade to Lucene 9, this PR
is only about agreeing on a migration strategy and documenting this change.

To avoid further breaks, I am leaning towards keeping the current setting name
even though it contains `bool`. I believe that it still makes sense given that
`bool` queries are typically the main contributors to high numbers of clauses.

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-07-21 12:16:30 +02:00
James Rodewig
b207aac9ed [DOCS] Increase search.max_bucket default value by one
Relates to #70645.
2021-06-29 08:38:24 -04:00
David Turner
3660d863db
Fork the sending of file chunks during recovery (#74164)
Today if sending file chunks is CPU-bound (e.g. when using compression)
then we tend to concentrate all that work onto relatively few threads,
even if `indices.recovery.max_concurrent_file_chunks` is increased. With
this commit we fork the transmission of each chunk onto its own thread
so that the CPU-bound work can happen in parallel.
2021-06-16 11:58:13 +01:00
David Turner
43ddd4a580
Fix docs rendering around recovery rate table (#73879)
- Replaces ⇐ with ≤
- Removes table caption
- Adjust table headers
- Fixes leading + on subsequent paragraphs
2021-06-08 15:00:00 +01:00
Luca Belluccini
3e41d753e3
[DOCS] Note circuit breakers reject requests with 429 HTTP status code (#69864)
We mention Elasticsearch returns 429 if the circuit breaker trips in https://www.elastic.co/blog/improving-node-resiliency-with-the-real-memory-circuit-breaker, but there is no mention in the docs.

This adds an xref to circuit breaker errors section.

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-06-02 10:31:24 -04:00
James Rodewig
d3c56e6fca [DOCS] Remove unneeded articles for Elasticsearch Service and Elastic Agent 2021-04-02 16:01:59 -04:00
James Rodewig
693807a6d3
[DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
David Turner
dd69ae95d7
Note recovery settings affect searchable snapshots (#70771)
Adds a short note that `max_restore_bytes_per_sec` and
`indices.recovery.max_bytes_per_sec` also affect the recovery of a
searchable snapshot index.
2021-03-24 09:22:44 +00: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
Jason Tedor
6e94e67ae9
Set recovery rate for dedicated cold nodes (#68480)
This commit sets the recovery rate for dedicated cold nodes. The goal is
here is enhance performance of recovery in a dedicated cold tier, where
we expect such nodes to be predominantly using searchable snapshots to
back the indices located on them. This commit follows a simple approach
where we increase the recovery rate as a function of the node size, for
nodes that appear to be dedicated cold nodes.
2021-02-04 10:36:07 -05:00
James Rodewig
4a2a97a058
[DOCS] Document the stack.templates.enabled setting (#68328) 2021-02-02 08:35:21 -05:00
Yang Cheng
168d98b7dd
limit the depth of nested bool queries (#66204)
limit the depth of nested bool queries 

Introduce a new node level setting `indices.query.bool.max_nested_depth`
that controls the depth of nested bool queries.
Throw an error if a nested depth of a bool query exceeds the maximum
allowed nested depth.

Closes #55303
2021-01-12 09:36:09 -05:00
Nik Everett
3e3152406a
Bust the request cache when the mapping changes (#66295)
This makes sure that we only serve a hit from the request cache if it
was build using the same mapping and that the same mapping is used for
the entire "query phase" of the search.

Closes #62033
2020-12-23 13:19:02 -05:00
James Rodewig
77dc63b2de
[DOCS] Fix search.max_buckets default (#66311) 2020-12-14 21:55:27 -05:00
Wylie Conlon
10ee0f2878
Clarify field data cache behavior in docs (#64375)
* Clarify that field data cache includes global ordinals
* Describe that the cache should be cleared once the limit is reached
* Clarify that the `_id` field does not supported aggregations anymore
* Fold the `fielddata` mapping parameter page into the `text field docs
* Improve cross-linking
2020-11-20 13:53:23 -08:00
James Rodewig
bbcd8078ce
[DOCS] Document dynamic index mgmt and buffer settings (#61753) 2020-09-04 10:19:42 -04:00
James Rodewig
a70c00a62c
[DOCS] Document dynamic cluster settings (#61760)
Co-authored-by: Adam Locke <adam.locke@elastic.co>
2020-09-01 15:48:45 -04:00
James Rodewig
d077a4f5a1
[DOCS] Document static field cache settings (#61424) 2020-08-26 17:10:08 -04:00
James Rodewig
8359232c45
[DOCS] Document dynamic circuit breaker settings (#61334) 2020-08-19 10:58:04 -04:00
James Rodewig
ae01606785
[DOCS] Replace twitter dataset in docs (#60604) 2020-08-03 12:49:56 -04:00
James Rodewig
441c3a21b1
[DOCS] Update my-index examples (#60132)
Changes the following example index names to `my-index-000001` for consistency:

* `my-index`
* `my_index`
* `myindex`
2020-07-27 14:46:39 -04:00
James Rodewig
2774cd6938
[DOCS] Swap [float] for [discrete] (#60124)
Changes instances of `[float]` in our docs for `[discrete]`.

Asciidoctor prefers the `[discrete]` tag for floating headings:
https://asciidoctor.org/docs/asciidoc-asciidoctor-diffs/#blocks
2020-07-23 11:48:22 -04:00
Nhat Nguyen
961db311f0
Sending operations concurrently in peer recovery (#58018)
Today, we send operations in phase2 of peer recoveries batch by batch 
sequentially. Normally that's okay as we should have a fairly small of
operations in phase 2 due to the file-based threshold. However, if
phase1 takes a lot of time and we are actively indexing, then phase2 can
have a lot of operations to replay.

With this change, we will send multiple batches concurrently (defaults 
to 1) to reduce the recovery time.
2020-07-07 18:00:03 -04:00
Adam Locke
3a1258fe97
[DOCS] Add supported ESS settings to ES docs (#57953)
* Adding ESS icons to supported ES settings.

* Adding new file for supported ESS settings.

* Adding supported ESS settings for HTTP and disk-based shard allocation.

* Adding more supported settings for ESS.

* Adding descriptions for each Cloud section, plus additional settings.

* Adding new warehouse file for Cloud, plus additional settings.

* Adding node settings for Cloud.

* Adding audit settings for Cloud.

* Resolving merge conflict.

* Adding SAML settings (part 1).

* Adding SAML realm encryption and signing settings.

* Adding SAML SSL settings.

* Adding Kerberos realm settings.

* Adding OpenID Connect Realm settings.

* Adding OpenID Connect SSL settings.

* Resolving leftover Git merge markers.

* Removing Cloud settings page and link to it.

* Add link to mapping source

* Update docs/reference/docs/reindex.asciidoc

* Incorporate edit of HTTP settings

* Remove "cloud" from tag and ID

* Remove "cloud" from tag and update description

* Remove "cloud" from tag and ID

* Change "whitelists" to "specifies"

* Remove "cloud" from end tag

* Removing cloud from IDs and tags.

* Changing link reference to fix build issue.

* Adding index management page for missing settings.

* Removing warehouse file for Cloud and moving settings elsewhere.

* Clarifying true/false usage of http.detailed_errors.enabled.

* Changing underscore to dash in link to fix ci build.
2020-07-02 14:13:06 -04:00
Yannick Welsch
118521d022
Account for recovery throttling when restoring snapshot (#58658)
Restoring from a snapshot (which is a particular form of recovery) does not currently take recovery throttling into account
(i.e. the `indices.recovery.max_bytes_per_sec` setting). While restores are subject to their own throttling (repository
setting `max_restore_bytes_per_sec`), this repository setting does not allow for values to be configured differently on a
per-node basis. As restores are very similar in nature to peer recoveries (streaming bytes to the node), it makes sense to
configure throttling in a single place.

The `max_restore_bytes_per_sec` setting is also changed to default to unlimited now, whereas previously it was set to
`40mb`, which is the current default of `indices.recovery.max_bytes_per_sec`). This means that no behavioral change
will be observed by clusters where the recovery and restore settings were not adapted.

Relates https://github.com/elastic/elasticsearch/issues/57023

Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2020-06-30 13:08:21 +02:00
James Rodewig
6ef9506beb
[DOCS] Correct setting type for indices.query.bool.max_clause_count (#56640)
#56449 incorrectly labelled this as a dynamic setting.

This corrects that error.
2020-05-12 16:25:41 -04:00
James Rodewig
af2d13144f
[DOCS] Add reference docs for search.max_buckets setting (#56449)
Adds reference-style setting documentation for the `search.max_buckets`
setting.

This setting was previously only documented on the [bucket
aggregations][0] page.

[0]: https://www.elastic.co/guide/en/elasticsearch/reference/master/search-aggregations-bucket.html
2020-05-11 08:35:24 -04:00
Stuart Tettemer
bd64da0960
Scripting: Deprecate general cache settings (#55038)
* Scripting: Deprecate general cache settings

* Add script.disable_max_compilations_rate setting

* Move construction to ScriptCache

* Use ScriptService to do updates of CacheHolder

* Remove fallbacks

* Add SCRIPT_DISABLE_MAX_COMPILATIONS_RATE_SETTING to ClusterSettings

* Node scope

* Use back compat

* 8.0 for bwc

* script.max_compilations_rate=2048/1m -> script.disable_max_compilations_rate=true in docker compose

* do not guard in esnode

* Doc update

* isSnapshotBuild() -> systemProperty 'es.script.disable_max_compilations_rate', 'true'

* Do not use snapshot in gradle to set max_compilations_rate

* Expose cacheHolder as package private

* monospace 75/5m in cbreaker docs, single space in using

* More detail in general compilation rate error

* Test: don't modify defaultConfig on upgrade
2020-04-22 12:33:33 -06:00
James Rodewig
5cbd05bb10
[DOCS] Relocate indices module content (#54903)
Moves `indices` content from the [Modules][0] section to the [Configuring
Elasticsearch][1] section.

Also removes the [Indices][2] landing page and adds a related redirect.

[0]: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules.html
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/master/settings.html
[2]: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-indices.html
2020-04-10 12:00:02 -04:00
David Turner
ac1b6eb5e9
indices.recovery.max_bytes_per_sec may be per-node (#54633)
The `indices.recovery.max_bytes_per_sec` recovery bandwidth limit can differ
between nodes if it is not set dynamically, but today this is not obvious. This
commit adds a paragraph to its documentation clarifying how to set different
bandwidth limits on each node.

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>
2020-04-02 18:14:34 +01:00
István Zoltán Szabó
451eb1fa1f
[DOCS] Expands the documentation of Node Query Cache (#51105)
Co-authored-by: debadair <debadair@elastic.co>
2020-01-20 11:11:57 +01:00
Stuart Tettemer
fb6ef69c6b
[DOCS] Deterministic scripted queries are cached (#50408)
Refs: #49321
2019-12-19 16:16:57 -07:00
Patryk Krawaczyński
de4f701a19 [DOCS] Document index.queries.cache.enabled as a static setting (#49886) 2019-12-10 14:23:14 -05:00