Commit graph

76812 commits

Author SHA1 Message Date
Jonathan Buttner
c2df24b2ba
[ML] Refactor models to expose fields used for rate limiting (#107444)
* Adding rate limit interface to openai and hugging face

* Adding cohere rate limit service settings

* Switching to request manager

* Adjusting constructor scope

* Removing uri from cohere

* Adding rate limit fields for azure

* Fixing spotless

* Only storing hash code values
2024-04-16 12:26:01 -04:00
David Kyle
f8fe610966
[ML] Add GET _inference for all inference endpoints (#107517) 2024-04-16 17:15:59 +01:00
Nhat Nguyen
c2a3ec4263
Leverage ordinals in enrich lookup (#107449)
This change leverages ordinals in enrich lookup. Instead of looking up 
and extracting enrich fields for all input terms, this improvement only
looks up and extracts the dictionary, then applies the ordinals to the
enrich results.

```
| 50th percentile | esql_stats_enrich_rates_fares | 242.949 | 34.7007 | -208.248 | ms |  -85.72% |
| 90th percentile | esql_stats_enrich_rates_fares | 245.479 | 36.3419 | -209.137 | ms |  -85.20% |
|100th percentile | esql_stats_enrich_rates_fares | 252.877 | 49.0826 | -203.795 | ms |  -80.59% |
```
2024-04-16 08:46:21 -07:00
Alexander Spies
1e4d4da483
ESQL: Make esql version required in REST requests (#107433)
* Enable corresponding validation in EsqlQueryRequest.
* Add the ESQL version to requests to /_query in integration tests.
* In mixed cluster tests for versions prior to 8.13.3, impersonate an 8.13
   client and do not send any version.

---------

Co-authored-by: Nik Everett <nik9000@gmail.com>
2024-04-16 17:06:09 +02:00
Mark J. Hoy
624a5b1fe5
Add Docs for Azure OpenAI Embeddings Inference (#107498)
* Update docs for Azure OpenAI Embeddings inference

* cleanups

* update link for dot_product similarity

* final cleanups
2024-04-16 10:52:27 -04:00
Mark Tozzi
225edaf607
Revert "[ES|QL] Moving argument compatibility checking for Equals (#105217)" (#107537)
* Revert "[ES|QL] Moving argument compatibility checking for Equals (#105217)"

This reverts commit af8e4bf26d.

* Update docs/changelog/107537.yaml
2024-04-16 10:51:28 -04:00
Moritz Mack
7e18768bbf
Adjust log level for publish failure in TransportPutShutdownNodeAction (#107489)
Publish failures are - to a certain degree - expected as the master
might change before the corresponding task is executed.
This reduces logging to INFO level for publish failures that will be
retried by TransportMasterNodeAction.
2024-04-16 16:22:28 +02:00
Przemysław Witek
69e3c22d00
[Transform] Prevent the ResourceNotFoundException from being thrown on force-stop (#107520) 2024-04-16 15:57:30 +02:00
Mark Tozzi
af8e4bf26d
[ES|QL] Moving argument compatibility checking for Equals (#105217)
Continuing my work from #104490, this PR moves the parameter compatibility checking for Equals into the type resolution check. This is a somewhat bigger change than for Add, as there was no ES|QL base class for binary comparison operators before this. I've added EsqlBinaryComparison as that base class, and migrated all of the binary comparisons to be based off of that (except for NullEquals, see note below).

In order to maintain compatibility with the current behavior, I've kept it so that unsigned longs are only inter-operable with other unsigned longs. We've talked a lot about changing that, and I consider this work a prerequisite for that.

I've also added a bunch of test cases to Equals and NotEquals, which should have the side effect of filling out the type support table in the equals docs. As noted in the comments, I'll have follow up PRs for the other binary comparisons to add tests, but this PR is already too long.

Note about NullEquals: There is an ES|QL NullEquals class, which inherits from the QL version, but I don't think it works. I didn't see any tests or docs for it, and trying it out in the demo instance gave me a syntax error. I think we need to delve into what's going on there, but this PR isn't the right place for it.
2024-04-16 09:47:25 -04:00
Kostas Krikellas
82c5eb0e26
Mute SnapshotStatusApisIT.testInfiniteTimeout (#107531)
Related to #107405
2024-04-16 08:56:53 -04:00
Slobodan Adamović
a09ae3fdae
Refactor role descriptor parsing (#107430)
The method for `RoleDescriptor` parsing is becoming more complex due to
its usage being shared between API keys, file-based and native roles.
In some cases we allow 2.X format, in others we disallow
restrictions. Having a single method with multiple boolean flags that
control inclusion/exclusion of fields is becoming hard to extend.
This refactoring aims to allow easier introduction of new fields that
should be conditionally supported in some cases but not others.
One of such cases is introduction of `description` field that should only
be supported for file-based and native roles but not for roles embedded
in API keys.

Relates to: #107088
2024-04-16 14:53:18 +02:00
Benjamin Trent
984e793e44
Add note about random sampler consistency (#107479) 2024-04-16 08:28:24 -04:00
Moritz Mack
e25f245802
Validate versions for CCR snapshot on matching index version. (#107179)
RestoreService will validate the snapshot based on max index version.
However, we do not increment index version on every single release.
To prevent attempting to restore an index of a future release, this change
rejects the restore already earlier when building the snapshot info from 
a newer node matching the current index version.
2024-04-16 14:19:12 +02:00
Przemysław Witek
5ba6d1f321
[Transform] Fix TransformRobustnessIT.testTransformLifecycleInALoop test (#107510) 2024-04-16 13:19:16 +02:00
Carlos Delgado
4413835b7f
Remove code remnants from semantic_text previous iterations in feature branch (#107508)
Removes changes for code already removed from the `semantic_text`
feature branch.

This is prep work for opening up `semantic_text` PRs in order to remove
irrelevant changes.
2024-04-16 07:10:28 -04:00
Bogdan Pintea
a2c2e8fe47
ESQL: extend BUCKET with spans. Turn it into a grouping function (#107272)
This extends `BUCKET` function to accept a two-parameters-only
invocation: the first parameter remains as is, while the second is a
span. It can be a numeric (floating point) span, if the first argument
is numeric, or a date period or time duration, if the first argument is
a date.

Also, the function can now be invoked with the alias BIN.

Additionally, the function has been turned into a grouping-only function
and thus can only be used within a `STATS` command.
2024-04-16 12:57:18 +02:00
David Turner
9626615fc3
Improve failure message for InternalTestCluster#getInstance (#107398)
Today if `InternalTestCluster#getInstance` fails to find a matching
instance it throws an opaque `AssertionError`. This commit adds a
message describing the problem to make troubleshooting easier.

Relates #107392
2024-04-16 06:53:08 -04:00
Ievgen Degtiarenko
dbd4c13605
Ensure executor is closed in case of failure (#107511)
This change ensures that executor is closed even in case of assertion failure
to prevent leaking threads.
2024-04-16 12:02:37 +02:00
Nikolaj Volgushev
4cca544ccb
Custom Roles - extension point for grant API key request translation (#107378)
Extension point to override Grant API key request translation (i.e.,
parsing) behavior.
2024-04-16 05:11:38 -04:00
Kostas Krikellas
d11048e7ff
Mute DocketTests.test150MachineDependentHeap (#107509)
Related to #104786
2024-04-16 04:34:18 -04:00
István Zoltán Szabó
2e847e8817
[DOCS] Documents the rerank task type of the Inference API (#107404)
* [DOCS] Documents the rerank task type of the Inference API.
2024-04-16 09:39:36 +02:00
Nikolaj Volgushev
d851c93f76
Invalidating cross cluster API keys requires manage_security (#107411)
This PR updates the privilege model to require `manage_security` cluster
privilege to invalidate cross cluster API keys, to better match the
access requirements of the creation and update APIs. Requests made with
lower privileges will receive descriptive errors in the response payload
indicating failure to invalidate, for each cross cluster API key. There
are no changes to invalidating REST API keys, nor to the Query or Get
APIs.
2024-04-16 03:11:24 -04:00
David Turner
a11562c146
Document behaviour of SubscribableListener on rejection (#107485)
It's possible that the `executor` passed in to a `SubscribableListener`
rejects the task it should execute. This commit adds to the Javadocs a
description of what happens if so.
2024-04-16 07:54:51 +01:00
George Katiforis
08a2f7991e
Fix regression in get index settings (human=true) where the version was not displayed in human-readable format (#107447) 2024-04-16 08:38:06 +02:00
Tim Vernum
2e66a8703b
Add ability to set project-id in test client (#107341)
This adds a "tests.rest.project.id" system property that causes the
default test rest client to pass the "X-Elastic-Project-Id" header in
HTTP requests
2024-04-15 21:59:21 -04:00
Nik Everett
8f2a615cb6
Fix ESQL's DivTests (#107492)
Sometimes ESQL's Div test generates random division that'll produce an
out of range number. They should produce a warning and a `null`, but the
tests still thought they should make `Infinity`. This flips the tests
around to expecting the right thing in that case.

Closes #107475
2024-04-15 19:39:56 -04:00
Fang Xing
353abef214
[ES|QL] Base64 decoding and encoding functions (#107390)
* add base64 functions
2024-04-15 18:39:26 -04:00
Jonathan Buttner
d8348560a9
muting (#107496)
Muting https://github.com/elastic/elasticsearch/issues/100062
2024-04-15 17:17:34 -04:00
Jonathan Buttner
a071209814
muting (#107495)
Muting https://github.com/elastic/elasticsearch/issues/106126
2024-04-15 17:10:22 -04:00
Moritz Mack
7706bedfe8
Fix monitoring-es-mb.json (#107486) 2024-04-15 13:57:41 -04:00
Parker Timmins
3288f46fd9
Allow writes to ILM shrink action target index (#107121)
The source index of a shrink action is made read-only to perform the shrink. During shrink, settings are copied from source index to target index, causing the target index to also be read-only. This change adds a shrink policy argument making the target index writable after shrinking. The default is to keep the read-only setting to preserve current behavior.

closes #106599
2024-04-15 11:56:38 -05:00
Oleksandr Kolomiiets
635824e186
Add counters for downsampling (#107389)
This PR adds counters for downsampling: success, failure and failure due
to invalid configuration. They will be used in TSDB dashboard to assess
health of downsampling functionality.
2024-04-15 11:42:03 -04:00
Jonathan Buttner
ae23a6f85a
Muting (#107484)
Muting https://github.com/elastic/elasticsearch/issues/103981
2024-04-15 11:36:47 -04:00
Jonathan Buttner
426d1f6c0e
Muting (#107482)
Muting https://github.com/elastic/elasticsearch/issues/107475

- DivTests
  - testEvaluateBlockWithNulls
  - testFold
2024-04-15 11:31:37 -04:00
Jedr Blaszyk
30be6c8f84
[Connector API] Add update filtering validation and activate draft endpoints (#107457) 2024-04-15 17:26:47 +02:00
Jedr Blaszyk
676c89e6ed
[Connector API] Unify API JSON rest spec (#107476) 2024-04-15 17:26:21 +02:00
Jedr Blaszyk
28e8197f4b
[Connector API] Fix bug with filtering validation toXContent (#107467) 2024-04-15 17:26:06 +02:00
Jonathan Buttner
22696627ab
Muting (#107480)
Muting https://github.com/elastic/elasticsearch/issues/105331
2024-04-15 11:24:11 -04:00
Alexander Spies
71b276da90
ESQL: Add version to docs (#107225)
Docs for https://github.com/elastic/elasticsearch/pull/106824.

Does not cover the [REST API
specs](https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/esql.query.json)
as these don't cover the request body.
2024-04-15 10:50:00 -04:00
Philipp Kahr
212e20304e
Update mapping for shard_stats.total_count (#107471)
* Update monitoring-es-mb.json

* Incrementing stack monitoring version
2024-04-15 16:41:46 +02:00
Nik Everett
e306dd1872
ESQL: Default ESQL version on old clients (#107438)
Soon we will require an ESQL version for all ESQL requests. Kibana is
sending it already. The official clients will start sending it in
version 8.14+. This defaults the version for the official clients before
8.14. It does so by reading a magic header the clients send,
`x-elastic-client-meta` and detecting the version string for any clients
that might possibly support ESQL - `es=8.11`, `es=8.12`, and `es=8.13`.
If we receive that we'll default to the first version of ESQL.

I've also made this work for kibana versions 8.12 and 8.13 - discover
will default to the old version of ESQL.
2024-04-15 09:58:00 -04:00
Jonathan Buttner
d2cdee3111
Muting Codec tests (#107470)
Muting https://github.com/elastic/elasticsearch/issues/107417
2024-04-15 09:49:12 -04:00
Pat Whelan
44c4788afb
[Transform] Check node shutdown before fail (#107358)
Transforms continue to run even when a node is shutting down. This may
lead to a transform failing and putting itself into a failed state,
which will prevent it from restarting when the node comes back online.

The transform will now abort rather than fail, which puts itself into a
started state. When the node comes back online, or another node in the
cluster starts the transform, then the transform will pick up from its
last successful saved state and checkpoint.

Close #100891
2024-04-15 09:48:03 -04:00
Jonathan Buttner
001680b8e7
Muting fetch fields with none stored_fields (#107468)
Muting https://github.com/elastic/elasticsearch/issues/107466
2024-04-15 09:35:08 -04:00
Jonathan Buttner
a0693a59fb
Muting testStackOverflow (#107465)
Muting https://github.com/elastic/elasticsearch/issues/107416
2024-04-15 09:14:39 -04:00
Jonathan Buttner
a2d6ffe712
Skipping failing test (#107464)
Muting https://github.com/elastic/elasticsearch/issues/107462
2024-04-15 09:10:06 -04:00
Tanguy Leroux
7d4920b878
Throw RequestedRangeNotSatisfiedException when BlobContainer.readBlob starts reading after blob length (#107408)
This change introduces a specialized exception RequestedRangeNotSatisfiedException 
that is thrown when FsBlobContainer or S3BlobContainer try to read a range of bytes 
from a position that is located after the real length of the blob.

This exception can then be caught to detect such situation and acts accordingly.
2024-04-15 15:05:26 +02:00
Mike Pellegrini
0a7b723a66
Add Index Metadata Map To Query Rewrite Context (#107075)
Add resolved indices info to QueryRewriteContext, which will be used by the upcoming semantic query.
2024-04-15 08:13:04 -04:00
Moritz Mack
e70e5397b7
Remove historical features for YAML REST tests in favor of synthetic version features (#107393) 2024-04-15 13:58:22 +02:00
Daniel Mitterdorfer
119f81f043
[Profiling] Add CO2/costs for TopN on top-level (#107304)
Wit this commit we add CO2 emission and cost information on the
top-level of the TopN functions API response. This is needed by the UI
to show summary info.
2024-04-15 13:08:31 +02:00