Commit Graph

51196 Commits

Author SHA1 Message Date
Mayya Sharipova 2ec1f6b4c4
Fix testIndexhasDuplicateData tests (#49786)
testIndexHasDuplicateData tests were failing ocassionally,
due to approximate calculation of BKDReader.estimatePointCount,
where if the node is Leaf, the number of points in it
was (maxPointsInLeafNode + 1) / 2.
As DEFAULT_MAX_POINTS_IN_LEAF_NODE = 1024, for small indexes
used in tests, the estimation could be really off.

This rewrites tests, to make the  max points in leaf node to
be a small value to control the tests.

Closes #49703
2020-03-19 13:09:50 -04:00
István Zoltán Szabó 8279f82dea
[DOCS] Fixes typo in start datafeed API docs. (#53811) 2020-03-19 17:55:26 +01:00
István Zoltán Szabó f2929fe2cd
[DOCS] Adds performance considerations section to transforms overview (#53791)
Co-Authored-By: Lisa Cawley <lcawley@elastic.co>
2020-03-19 17:49:19 +01:00
Lisa Cawley 0edfbd7179
[DOCS] Adds example links to transform tutorial (#53640) 2020-03-19 09:40:29 -07:00
Benjamin Trent 783df3f961
[ML] only retry persistence failures when the failure is intermittent and stop retrying when analytics job is stopping (#53725)
This fixes two issues:


- Results persister would retry actions even if they are not intermittent. An example of an persistent failure is a doc mapping problem.
- Data frame analytics would continue to retry to persist results even after the job is stopped.

closes https://github.com/elastic/elasticsearch/issues/53687
2020-03-19 11:15:55 -04:00
Costin Leau f58680bad3
EQL: Add Substring function with Python semantics (#53688)
Does not reuse substring from SQL due to the difference in semantics and
the accepted arguments.
Currently it is missing full integration tests as, due to the usage of 
scripting, requires an actual integration test against a proper cluster (and 
likely its own QA project).
2020-03-19 16:58:54 +02:00
István Zoltán Szabó 57321124ea
[DOCS] Changes seconds to milliseconds since the Epoch in AD docs. (#53797) 2020-03-19 15:40:53 +01:00
David Turner c1dc5238da
Apply cluster states in system context (#53785)
Today cluster states are sometimes (rarely) applied in the default context
rather than system context, which means that any appliers which capture their
contexts cannot do things like remote transport actions when security is
enabled.

There are at least two ways that we end up applying the cluster state in the
default context:

1. locally applying a cluster state that indicates that the master has failed
2. the elected master times out while waiting for a response from another node

This commit ensures that cluster states are always applied in the system
context.

Mitigates #53751
2020-03-19 14:13:52 +00:00
Lee Hinman d47d74a558
Fix feature flag setting for ComponentTemplate APIs (#53758)
The feature flag was set for *most* of the builds, but there are a couple where it was missing.

Resolves #53708
2020-03-19 08:00:06 -06:00
Ignacio Vera 112ae9cb17
Add support for distance queries on shape queries (#53468)
With the upgrade to Lucene 8.5, XYShape field has support for distance queries. This change implements this new feature and removes the limitation.
2020-03-19 14:27:38 +01:00
Ignacio Vera 6eb698bc6d
Add support for distance queries on geo_shape queries (#53466)
With the upgrade to Lucene 8.5, LatLonShape field has support for distance queries. This change implements this new feature and removes the limitation.
2020-03-19 14:16:08 +01:00
Alan Woodward c6cdd3a4c2 Revert "Report parser name and location in XContent deprecation warnings (#53752)"
This reverts commit 7636930ceb.

There is some randomization in the YAML test suite which means we can't check
for exact xcontentlocation in the deprecation warning headers.
2020-03-19 12:29:42 +00:00
James Rodewig 8d5478f56c
[DOCS] Add token graph concept docs (#53339)
Adds conceptual docs for token graphs.
These docs cover:

* How a token graph is constructed from a token stream
* How synonyms and multi-position tokens impact token graphs
* How token graphs are used during search
* Why some token filters produce invalid token graphs

Also makes the following supporting changes:
* Adds anchors to the 'Anatomy of an Analyzer' docs for cross-linking
* Adds several SVGs for token graph diagrams
2020-03-19 07:42:26 -04:00
Alan Woodward 7636930ceb
Report parser name and location in XContent deprecation warnings (#53752)
It's simple to deprecate a field used in an ObjectParser just by adding deprecation
markers to the relevant ParseField objects. However, the warnings themselves don't 
currently have any context; they simply say that a deprecated field has been used, 
but not where in the input it appears. This commit adds the parent object parser
name and XContentLocation to these deprecation messages.
2020-03-19 11:26:04 +00:00
Alan Woodward 5c8cd16ab3
TermsLookup uses ObjectParser for x-content parsing (#53733)
This commit refactors the fromXContent method in TermsLookup to use an
ObjectParser and adds an explicit parsing test.

Related to #53731
2020-03-19 10:21:43 +00:00
Dimitris Athanasiou 55535b6be7
[ML] Register ML featureset in XPackClientPlugin (#53772)
Featureset needs to stay in XPackClientPlugin for now.
2020-03-19 11:10:22 +02:00
Przemyslaw Gomulka 1dac8dffc6
Fix NPE when logging null values in JSON (#53715)
Slow log's routing value when null was causing ESLogMessage.asJson
method to throw Null Pointer Exception. This should be fixed in
ESLogMessage as well as prevent passing that key at all.
This only happens in 8 because of previous refactoring #46702
2020-03-19 08:48:24 +01:00
Jim Ferenczi a2b428f5b4
Disable distributed sort optimization on scroll requests (#53759)
This commit disables the sort optimization added in #51852 for scroll requests.
Scroll queries keep a state per shard so we cannot modify the request on
the first round (submit).
This bug was introduced in non-released versions which is why this pr
is marked as a non-issue.
2020-03-19 08:10:34 +01:00
Jason Tedor ca7a135e08
Improve performance of shards limits decider (#53577)
On clusters with a large number of shards, the shards limits allocation
decider can exhibit poor performance leading to timeouts applying
cluster state updates. This occurs because for every shard, we do a loop
to count the number of shards on the node, and the number of shards for
the index of the shard. This is roughly quadratic in the number of
shards. This loop is not necessary, since we already have a O(1) method
to count the number of non-relocating shards on a node, and with this
commit we add some infrastructure to RoutingNode to make counting the
number of shards per index O(1).
2020-03-18 20:57:50 -04:00
Lisa Cawley 35ad63036e
[DOCS] Add transform nodes (#53698) 2020-03-18 15:23:41 -07:00
Benjamin Trent 3dae2e97d8
[Transform] renamed _cat/transform to _cat/transforms (#53743)
renaming _cat/transform to  _cat/transforms for uniformity with the other _cat apis.
2020-03-18 18:23:01 -04:00
Dimitris Athanasiou 6a04394aaf
[ML] Register ML named writeables from ML plugin (#53757)
... instead of XPackClientPlugin.
2020-03-18 23:00:12 +02:00
Andy Bristol 73d2addaa2
supported field type tests for max agg (#53701)
Adds test hooks for testing supported ValuesSource types for the max
aggregation
2020-03-18 13:19:13 -07:00
Jason Tedor 36d8d84817
Upgrade the bundled JDK to JDK 14 (#53748)
This commit upgrades the bundled JDK to JDK 14.
2020-03-18 16:16:58 -04:00
Ryan Ernst 9467dbf120
Decouple AuditTrailService from AuditTrail (#53450)
The AuditTrailService has historically been an AuditTrail itself, acting
as a composite of the configured audit trails. This commit removes that
interface from the service and instead builds a composite delegating
implementation internally. The service now has a single get() method to
get an AuditTrail implementation which may be called. If auditing is not
allowed by the license, an empty noop version is returned.
2020-03-18 12:43:15 -07:00
Jim Ferenczi f26ccb2ab1
Restore bwc tests (#53754)
This change restores the bwc tests now that #53659 is merged.
2020-03-18 20:29:25 +01:00
Christoph Büscher ddedb94b6c
Add unsupported parameters to HLRC search request (#53745)
Currently we don't send values for the `pre_filter_shard_size` and
`max_concurrent_shard_requests` SearchRequest parameters over http when using
the High Level Rest Client. This change adds these parameters to the
RequestConverters and tests.
2020-03-18 19:59:30 +01:00
James Rodewig 03caeaad79
[DOCS] Remove incorrect parms from put index template API docs (#53750)
Removes the `flat_settings` and `timeout` query parameters from the JSON
spec and asciidoc docs for the put index template API.

These parameters are not supported by the API.
2020-03-18 14:33:40 -04:00
Stuart Tettemer 070ea7eff1
Scripting: Per-context script cache, default off (#52855)
* Adds per context settings:
  `script.context.${CONTEXT}.cache_max_size` ~
  `script.cache.max_size`

  `script.context.${CONTEXT}.cache_expire` ~
  `script.cache.expire`

  `script.context.${CONTEXT}.max_compilations_rate` ~
  `script.max_compilations_rate`

* Context cache is used if:
  `script.max_compilations_rate=use-context`.  This
  value is dynamically updatable, so users can
  switch back to the general cache if desired.

* Settings for context caches take the first value 
  that applies:
  1) Context specific settings if set, eg
     `script.context.ingest.cache_max_size`
  2) Correlated general setting is set to the non-default 
     value, eg `script.cache.max_size`
  3) Context default

The reason for 2's inclusion is to allow an easy
transition for users who've customized their general
cache settings.

Using the general cache settings for the context caches
results in higher effective settings, since they are 
multiplied across the number of contexts.  So a general
cache max size of 200 will become 200 * # of contexts.
However, this behavior it will avoid users snapping to a
value that is too low for them.


Refs: #50152
2020-03-18 12:31:30 -06:00
Ioannis Kakavas c46e0f596f
Mute failing tests (#53749) 2020-03-18 19:43:26 +02:00
Ioannis Kakavas 022ad0a56b Revert "Mute TimeSeriesLifecycleActionsIT (#53740)"
This reverts commit a29a83e29c.
2020-03-18 18:49:55 +02:00
Dominic Page d1cbdfb753
Geo shape query vs geo point (#52382)
Enable geo_shape query to work on geo_point fields for shapes: circle, polygon, multipolygon, rectangle

see: #48928

Co-Authored-By:  @iverase
2020-03-18 17:03:52 +01:00
markharwood 024deb41a4
Wildcard field docs formatting fix
Bullet points weren't rendering correctly
2020-03-18 15:38:00 +00:00
Ioannis Kakavas a29a83e29c
Mute TimeSeriesLifecycleActionsIT (#53740)
see #53738
2020-03-18 17:31:36 +02:00
Lisa Cawley f605ec2d3c
[DOCS] Adds stub for cat transform API (#53737) 2020-03-18 08:29:18 -07:00
James Rodewig c89ba8a096
[DOCS] Add temporary redirect for missing Component Template API docs (#53735)
The following API spec files contain a link to a not-yet-created
doc page for the component template APIs:

* [cluster.delete_component_template.json][0]
* [cluster.get_component_template.json][1]
* [cluster.put_component_template.json][2]

The Elaticsearch-js client uses these spec files to create their docs.
This created a broken link in the Elaticsearch-js, which has broken
the docs build.

This PR adds a temporary redirect for the docs page. This redirect
should be removed when the actual API docs are added.

[0]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.delete_component_template.json
[1]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_component_template.json
[2]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_component_template.json
2020-03-18 11:20:55 -04:00
Alan Woodward ddaf3534d9
Use QueryVisitor when extracting PercolatorQuery list for highlighting (#53728)
The highlighting phase for percolator queries currently uses some custom query
traversal logic to find all instances of PercolatorQuery in the query tree for the
current search context. This commit converts things to instead use a QueryVisitor,
which future-proofs us against new wrapper queries or queries from custom
plugins that the percolator module doesn't know about.
2020-03-18 15:18:49 +00:00
Luca Cavanna 97cf64f6aa
[TEST] Replace agg key in async search yaml test (#53727)
Some clients have problems running this test as a numeric key is treated like an array index by default.
We can work around this by renaming the aggregation key to not be a numeric.
2020-03-18 16:15:35 +01:00
Alan Woodward e23311ce51
Make it possible to deprecate all variants of a ParseField with no replacement (#53722)
Sometimes we want to deprecate and remove a ParseField entirely, without replacement;
for example, the various places where we specify a _type field in 7x. Currently we can
tell users only that a particular field name should not be used, and that another name should
be used in its place. This commit adds the ability to say that a field should not be used at
all.
2020-03-18 14:15:30 +00:00
Alan Woodward 534a4a9b32
Remove [removal-of-types] docs page, and point to 7x docs (#53670)
Given that types have been removed entirely in 8.0, we don't need a detailed page
explaining what they are and why they are going away. This commit replaces the
page with a short paragraph saying that types are no longer supported, and a link
to the [removal-of-types] page in 7x

Relates to #41059
2020-03-18 14:13:00 +00:00
Jake Landis afc2383b72
Optimize which Rest resources are used by the Rest tests. (#53299)
This should help with Gradle's incremental compile such that projects
only depend upon the resources they use.

related #52114
2020-03-18 09:09:29 -05:00
Jake Landis 3ef3cc571f
Add Watcher to available rest resources (#53620)
Prior to this commit Watcher explicitly copied test between two
projects with a copy task. This commit removes the explicit copy in favor
of adding the Watcher tests to the available restResources that may be
copied between projects.

This is how inter-project dependencies should be modeled. However, only
Watcher is included here since it is (currently) the only project with
inter-project test dependencies.

Note - this re-introduces: commit: 4f48e053f9
with some additional fixes.
2020-03-18 09:08:13 -05:00
markharwood 9f0562be67
Fix highlighter support in PinnedQuery and added test (#53716)
Closes #53699
2020-03-18 14:01:25 +00:00
Marios Trivyzas 6b5fc35e44
Increase step between checks for cancellation (#53712)
The introduction of the ExitableDirectoryReader showed increase of
latencies for range queries using pointvalues.

Check for cancellation every 1024 docs instead of every 15 to lower
the impact of the check in query's performance.

Follows: #52822
Fixes: #53496
2020-03-18 14:52:03 +01:00
James Rodewig f2a2dcbb8a
[DOCS] Streamline `analyzer` mapping parm def (#51874)
Simplifies the `analyzer` mapping parameter definition to remove
duplicated analysis content and examples.
2020-03-18 09:42:25 -04:00
zacharymorn 110ff6cdd1
Create GET _cat/transforms API Issue (#53643)
Adds new` _cat/transform` and `_cat/transform/{transform_id}` endpoints.
2020-03-18 09:16:26 -04:00
Jim Ferenczi de9e44fb68
Adapt serialization version checks in ShardSearchRequest (#53660)
This change adapts the serialization checks to 7.7.0 in order to cope with #53659.
Note that this commit also disables the bwc tests temporarily in order to be able to
merge #53659 first.

Relates #51852
2020-03-18 14:14:54 +01:00
Ioannis Kakavas dfb779ec8d
Mute testHistoryIsWrittenWithDeletion (#53719)
see #53718
2020-03-18 14:50:10 +02:00
James Rodewig 3a39ed0055
[DOCS] Remove `light_bengali` stemmer (#53697)
Only the `bengali` stemmer is available in Lucene and surfaced through
Elasticsearch. This removes the incorrect `light_bengali` link in our
docs.
2020-03-18 08:33:20 -04:00
Tanguy Leroux e1096b9457
Restore off-heap loading for term dictionary in ReadOnlyEngine (#53713)
This is a partial restore of #43158, following decision taken in #51247

Closes #51247
2020-03-18 13:23:45 +01:00