Commit Graph

59072 Commits

Author SHA1 Message Date
Przemyslaw Gomulka 6d34a38cb1
Fix EnsureNoWarning assertion (#73647)
EnsureNoWarnings method should assert that there is no other warnings
than the allowed "predefined" warnings in filteredWarnings() method

bug introduced in #71207
2021-06-02 17:55:14 +02:00
István Zoltán Szabó 44c26c8bdc
[DOCS] Removes Kibana charts-related advise about agg interval and bucket span. (#73673) 2021-06-02 16:47:01 +02: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
Lee Hinman 8d0fe6f498
Add _meta information to built-in ILM policies (#73629)
We already ship templates that include the _meta map for things like component and composable
index templates, and we use the "managed": true indicator for many of our built-in items within
Elasticsearch.

This commit adds a description and managed flag to each of the ILM policies we ship by default.
2021-06-02 07:58:21 -06:00
Nik Everett 4b5aebe8b0
Add setting to disable aggs optimization (#73620)
Sometimes our fancy "run this agg as a Query" optimizations end up
slower than running the aggregation in the old way. We know that and use
heuristics to dissable the optimization in that case. But it turns out
that the process of running the heuristics itself can be slow, depending
on the query. Worse, changing the heuristics requires an upgrade, which
means waiting. If the heurisics make a terrible choice folks need a
quick way out. This adds such a way: a cluster level setting that
contains a list of queries that are considered "too expensive" to try
and optimize. If the top level query contains any of those queries we'll
disable the "run as Query" optimization.

The default for this settings is wildcard and term-in-set queries, which
is fairly conservative. There are certainly wildcard and term-in-set
queries that the optimization works well with, but there are other queries
of that type that it works very badly with. So we're being careful.

Better, you can modify this setting in a running cluster to disable the
optimization if we find a new type of query that doesn't work well.

Closes #73426
2021-06-02 09:12:54 -04:00
Tanguy Leroux 4927b6917d
Delete mounted indices after test case in ESRestTestCase (#73650)
This commit adds some clean up logic to ESRestTestCase so 
that searchable snapshots indices are deleted after test case 
executions, before the snapshot and repositories are wipe out.

Backport of #73555
2021-06-02 15:06:44 +02:00
Alexander Reelsen f5a1d94cc9
[DOCS] Fix create component template API request path (#72874) 2021-06-02 09:04:58 -04:00
James Rodewig 75bf92c050
[DOCS] Update service account creation docs for GCS repository plugin (#73561) (#73664)
There are some changes in GCP. The service accounts are now their own button and not a child under the IAM/permissions anymore.

Co-authored-by: Philipp Kahr <philipp.kahr@elastic.co>
2021-06-02 09:01:06 -04:00
James Rodewig f1e1661088
[DOCS] Reuse `aliases` object properties in API docs (#73421)
Changes:
* Reuses the same `aliases` object properties in the following API docs:
  * Clone index API
  * Create index API
  * Put component template API
  * Put legacy index template API
  * Put index template API
  * Rollover index API
  * Shrink index API
  * Simulate template API
  * Split index API
* Updates the `aliases` object properties for the simulate index API docs.

Closes #73044
2021-06-02 08:31:42 -04:00
Armin Braun 31643a59e5
Remove Dead Branch from IndexMetadataGenerations#withAddedSnapshot (#73658)
We never do (nor should) call this method to overwrite a snapshots existing entry,
checks and assertions upstream make sure of that.
=> simplified the code accordingly
2021-06-02 14:29:25 +02:00
Ignacio Vera b2619ec24c
Specialise ScriptDocValues#GeoPoints for single values (#73656) 2021-06-02 13:06:00 +02:00
David Turner ceb3099511
Rename AsyncLucenePersistedState to AsyncPersistedState (#73652)
This class actually has nothing to do with Lucene. This commit adjusts the name
to match.
2021-06-02 11:44:53 +01:00
David Turner 92fb60d154
Use NIOFSDirectory in PersistedClusterStateService (#73654)
Today we use `SimpleFSDirectory` in `PersistedClusterStateService` since
we don't need anything fancy. `SimpleFSDirectory` is today deprecated
since it's strictly worse than `NIOFSDirectory` so this commit removes
usages of the deprecated class.
2021-06-02 11:33:37 +01:00
David Turner f1abcf1531
Write next cluster state fully on all failures (#73631)
Today we do not set the `LucenePersistedState#writeNextStateFully` flag
on all failures, notably on an `OutOfMemoryError`. Since we don't exit
immediately on an OOME we may have failed part-way through writing a
full state but still proceed with another apparently-incremental write.

With this commit we ensure `LucenePersistedState#writeNextStateFully` is
only set if the previous write was successful.
2021-06-02 11:18:34 +01:00
Martijn van Groningen 27dfc58bd6
Take include_aliases flag into account when restoring data stream aliases (#73595)
Take RestoreSnapshotRequest#includeAliases() into account when restoring data stream aliases from a snapshot into a cluster.

Relates to #66163
2021-06-02 11:02:24 +02:00
Martijn van Groningen 6b2322f827
Also rename write data stream alias during a restore. (#73588)
Rename during a restore should also rename write data stream in data stream alias.

Relates to #66163
2021-06-02 11:01:59 +02:00
Dimitris Athanasiou 3cb28635df
[ML] Remove unnecessary creation of JobDataDeleter (#73645)
... in one of its own methods. This is a cleanup following
in the backport #73644.
2021-06-02 11:18:43 +03:00
Armin Braun aaa45cef37
Cache RepositoryData Outright instead of Serialized (#73190)
Serializing and compressing `RepositoryData` seems to have been the wrong trade-off in hindsight.
While saving some heap on a quiet master it makes every repository operation cost heap for
the a newly instantiated `RepositoryData`. Concurrent repository operations and snapshot API
requests can thus easily lead to many duplicate instances on heap causing memory pressure.
Limiting caching to smaller instances also appears to have been the wrong choice in hindsight.
While duplication of a few 100kb instances of `RepositoryData` is mostly not a big deal, duplicating
a `5MB` instance a couple of times (e.g. seen during heavily concurrent get snapshots requests)
eventually becomes a problem.
2021-06-02 10:01:13 +02:00
Tim Vernum d58fe5159c
[DOCS] Add notes on SSL version by JDK version (#73401)
Recent JDK releases have disabled TLS v1.0 and TLS v1.1 by default

See
 - https://java.com/en/jre-jdk-cryptoroadmap.html
 - https://bugs.openjdk.java.net/browse/JDK-8202343

This change adds documentation clarifying which TLS versions are
supported on which JDKs (in general terms, rather than specific builds)
and how to change the configuration if necessary.

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2021-06-02 17:33:33 +10:00
Dimitris Athanasiou 443e09ffdd
[ML] Make job data deletion reusable (#73602)
This commit moves the logic for deleting job data
from the `TransportDeleteJobAction` into the `JobDataDeleter`
class in order to allow reusing it. In particular, it will
be necessary for the implementation of the reset API.
2021-06-02 09:47:12 +03:00
David Roberts 51703ed419
[ML] Unmute ml_info REST compat test (#73606)
Once https://github.com/elastic/elasticsearch/pull/73605
is merged this test should pass on master.
2021-06-02 07:46:47 +01:00
Luca Cavanna 4ca2e0300b
ExistsQueryBuilder to no longer rely on getMatchingFieldTypes (#73617)
We've been discussing possibly removing `FieldTypeLookup#getMatchingFieldTypes`, or at least its `SearchExecutionContext` variant that applies runtime mappings.

This is another step in that direction: the exists query can rely on getMatchingFieldNames instead, and look up field types by name.
2021-06-02 08:33:01 +02:00
Nhat Nguyen 1c3ca3ace5 Revert "Mute SearchStatesIT"
This reverts commit b6b6ceedd5.
2021-06-01 21:17:35 -04:00
Mark Vieira b6b6ceedd5 Mute SearchStatesIT 2021-06-01 16:22:40 -07:00
William Brafford 80ea64cd2e
[8.x] OsStats must be lenient with bad data from older nodes (#73610)
We've had a series of bug fixes for cases where an OsProbe gives negative
values, most often just -1, to the OsStats class. We added assertions to catch
cases where we were initializing OsStats with bad values. Unfortunately, these
fixes turned to not be backwards-compatible. In this commit, we simply coerce
bad values to 0 when data is coming from nodes that don't have the relevant bug
fixes.

Relevant PRs:
* #42725
* #56435
* #57317

Fixes #73459
2021-06-01 18:52:55 -04:00
Lee Hinman 3d80e77ffa
Add `data-streams-mappings` to isXPackTemplate method (#73633)
This template was added in #64978, however, there can be some test failures if we try to remove
built-in templates. It was missing from the list and now needs to be added back.
2021-06-01 16:25:56 -06:00
James Baiera c13384ce01
Add X-Elastic-Product header on all http responses (#73434)
* Add product response header to all responses

* share header value privately across package

* Make the product header lowercase.

* Do not expose the product header if request is unauthenticated.

* Fix checkstyle

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-06-01 16:46:03 -04:00
Gordon Brown 5fe5b5339e
Trigger a reroute after registering a node for removal (#73449)
The cluster will not automatically react to the node shutdown being
registered unless we notify it that something has changed that may
require a change in shard allocation. This commit modifies the Put
and Delete Shutdown actions to invoke a reroute after the cluster 
state has been updated, as well as an integration test to verify that
shards quickly move away from nodes which are shutting down for
removal.
2021-06-01 13:50:49 -06:00
Lee Hinman 60336c4dd5
Adjust ILM policy version and re-enable BWC testing (#73628)
This re-enables the BWC removed in #73625 now that #73624 has been merged
2021-06-01 13:18:17 -06:00
Lee Hinman 78905ba80e
Disable BWC testing for ILM _meta backport (#73625)
This commit disables BWC tests until the PRs adding `_meta` to ILM policies can be backported and
version constants added.

Relates: #73515, #73624
2021-06-01 12:12:27 -06: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 5180f75c70
[DOCS] Use `bool` query in alias filter example (#73619)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-06-01 12:05:40 -04:00
Rene Groeschke 06103cd9ac
Fix path in TESTING.asciidoctor 2021-06-01 16:56:29 +02:00
Rene Groeschke 94f07c4942
Fix docs path for docs PR to pass 2021-06-01 16:55:13 +02:00
James Rodewig 3e019a4d56
[DOCS] Note only ES should lock `path.data` files (#73596)
If another service, such as an antivirus or backup program, opens and
locks files in the `path.data` directory, Elasticsearch may return errors.
2021-06-01 10:36:47 -04:00
James Rodewig 8212f15424
[DOCS] Update `is_write_index` example (#73601)
Changes:
* Updates the write index snippet to use data streams
* Notes data streams aliases don't set an implicit write stream, even if the alias points to one data stream.
2021-06-01 10:30:17 -04:00
David Roberts 0059c59e25
[ML] Make ml_standard tokenizer the default for new categorization jobs (#72805)
Categorization jobs created once the entire cluster is upgraded to
version 7.14 or higher will default to using the new ml_standard
tokenizer rather than the previous default of the ml_classic
tokenizer, and will incorporate the new first_non_blank_line char
filter so that categorization is based purely on the first non-blank
line of each message.

The difference between the ml_classic and ml_standard tokenizers
is that ml_classic splits on slashes and colons, so creates multiple
tokens from URLs and filesystem paths, whereas ml_standard attempts
to keep URLs, email addresses and filesystem paths as single tokens.

It is still possible to config the ml_classic tokenizer if you
prefer: just provide a categorization_analyzer within your
analysis_config and whichever tokenizer you choose (which could be
ml_classic or any other Elasticsearch tokenizer) will be used.

To opt out of using first_non_blank_line as a default char filter,
you must explicitly specify a categorization_analyzer that does not
include it.

If no categorization_analyzer is specified but categorization_filters
are specified then the categorization filters are converted to char
filters applied that are applied after first_non_blank_line.

Closes elastic/ml-cpp#1724
2021-06-01 15:11:32 +01:00
Adam Locke 88dfe1aebf
[DOCS] Remove errant note (#73597) (#73600) 2021-06-01 09:41:09 -04:00
Tanguy Leroux d499061c30
Mute RestClientMultipleHostsIntegTests.testCancelAsyncRequests (#73592)
Relates #45577
2021-06-01 14:57:51 +02:00
James Rodewig 74bc81c23e
[DOCS] Update alias API docs for data stream aliases (#73419)
Updates the docs for several alias APIs for data stream aliases. Also
removes some redundant examples now covered in the [aliases guide][0].

[0]: https://www.elastic.co/guide/en/elasticsearch/reference/master/alias.html
2021-06-01 08:45:22 -04:00
Rene Groeschke dce50a47e2
Update contributing.md after renaming buildSrc to build-tools-internal 2021-06-01 12:45:19 +02:00
Rene Groeschke d06801c503
Fix version.properties after merge 2021-06-01 11:44:06 +02:00
Rene Groeschke 6549c55060
Update version properties after merge 2021-06-01 11:32:36 +02:00
Rene Groeschke b2a183baf0
Move public build api into included build (#72861)
This moves the public build api and plugins into a separete included build called 'build-tools' 
and we removed the duplication of included buildSrc twice (2nd import as build-tools).

The elasticsearch internal build logic is kept in build-tools-internal as included build which allows us better handling of this project that its just being an buildSrc project (e.g. we can reference tasks directly from the root build etc.)

Convention logic applied to both projects will live in a new build-conventions project.
2021-06-01 11:19:30 +02:00
Dimitris Athanasiou 84def3cade
[ML] Remove unused auditor in JobResultsPersister (#73567)
The `auditor` member in `JobResultsPersister` has been
left unused. This commit removes it entirely.
2021-06-01 11:56:28 +03:00
István Zoltán Szabó 7477a644fb
[DOCS] Changes relative links to absolute ones in Node changes. (#73583) 2021-06-01 10:47:32 +02:00
David Turner e027ce977c
Extend version barrier to all upgrades (#73358)
Today when upgrading to the next major version we have a so-called
_major version barrier_: once the cluster comprises nodes of the new
major version then nodes of the previous major version are prevented
from joining the cluster. This means we can be certain that
`clusterState.nodes().getMinNodeVersion().major` will never decrease, so
we can implement upgrade logic that relies on the cluster remaining in
its wholly-upgraded state.

This commit generalises this behaviour to apply to all upgrades, so that
we can be certain that `clusterState.nodes().getMinNodeVersion()` will
never decrease in a running cluster.

Closes #72911
2021-06-01 09:07:23 +01:00
David Turner 2feb48731a
Document removal of MDP as a breaking change (#73578)
Records that the removal of multiple data paths (#71205) is a breaking
change. Includes a copy of the migration process introduced in #73367.
2021-06-01 08:56:02 +01:00
Tanguy Leroux 3336bb8c7c
Fix small inconsistency in doc_stats search source (#73372)
This commit fixes a small inconsistency in the FrozenEngine 
and Engine classes when they refer to the source used to 
open a Searcher for loading doc stats.
2021-06-01 09:35:11 +02:00
David Turner a4015fde9b
Expand Javadoc for AllocationService#reroute (#73512)
Notes that this method can be expensive and recommends the preferred way
to call it.
2021-06-01 07:32:03 +01:00