Commit graph

19695 commits

Author SHA1 Message Date
Jonathan Buttner
8e0980e30d
[ML] Adding missing onFailure call for Inference API start model request (#126930) (#126941)
* Adding missing onFailure call

* Update docs/changelog/126930.yaml
2025-04-18 02:03:43 +10:00
Jonathan Buttner
4522eb773c
[ML] Refactor inference request executor to leverage scheduled execution (#126858) (#126949)
* Using threadpool schedule and fixing tests

* Update docs/changelog/126858.yaml

* Clean up

* change log

(cherry picked from commit 7a0f63c1a0)

# Conflicts:
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/external/http/sender/HttpRequestSenderTests.java
2025-04-17 23:33:48 +10:00
Luigi Dell'Aquila
d53a324ee5
[8.18] ES|QL: make telemetry more strict (#126940) (#126980)
* ES|QL: make telemetry more strict (#126940)

* Fix compile

* Fix tests

* Fix test
2025-04-17 21:40:19 +10:00
Carson Ip
642d26eb63
[otel-data] Bump plugin version to release _metric_names_hash changes (#126850) (#126896)
Bump otel-data plugin version as #120952 missed the bump.
2025-04-17 20:19:45 +10:00
Luca Cavanna
7c19504e2e
[8.18] Cancel expired async search task when a remote returns its results (#126583) (#126916)
* Cancel expired async search task when a remote returns its results (#126583)

A while ago we enabled using ccs_minimize_roundtrips in async search.
This makes it possible for users of async search to send a single search
request per remote cluster, and minimize the impact of network latency.

With non minimized roundtrips, we have pretty recurring cancellation checks:
as part of the execution, we detect that a task expired whenever each shard comes
back with its results.

In a scenario where the coord node does not hold data, or only remote data is
targeted by an async search, we have much less chance of detecting cancellation
if roundtrips are minimized. The local coordinator would do nothing other than
waiting for the minimized results from each remote cluster.
One scenario where we can check for cancellation is when each cluster comes
back with its full set of results. This commit adds such check, plus some testing
for async search cancellation with minimized roundtrips.

* compile error
2025-04-17 20:10:12 +10:00
Parker Timmins
c6876ebeca
Fix reindex yaml test (#126942) (#126958)
Reindex task may not have completed by time status is called, so remove assertion that relies on this. Following assertions are set in the action which starts task, so will be correct whether or not task has completed.
2025-04-17 09:00:38 +10:00
Nik Everett
c9e7e5a4ce
ESQL: Allow some error in test (#126865)
Without #123290 we're not going to get accurate status reports. They are
indicative, but not accurate.

Closes #126808
2025-04-15 15:19:25 -04:00
Carson Ip
8957c837c0
Add _metric_names_hash field to OTel metric mappings (#120952) (#126848)
If metrics that have the same timestamp and dimensions aren't grouped into the same document, ES will consider them to be a duplicate.
The _metric_names_hash field will be set by the OTel ES exporter.
As it's mapped as a time_series_dimensions, it creates a different _tsid for documents with different sets of metrics.
The tradeoff is that if the composition of the metrics grouping changes over time, a different _tsid will be created.
That has an impact on the rate aggregation for counters.

(cherry picked from commit 5e8865deac)

Co-authored-by: Felix Barnsteiner <felixbarny@users.noreply.github.com>
2025-04-15 16:45:34 +02:00
Jan Kuipers
a563c9176e
License check for ES|QL categorize (#126595) (#126835) 2025-04-15 21:46:13 +10:00
Ben Chaplin
6d57db91f3
Remove unnecessary request from log tests (#126556) (#126699)
(cherry picked from commit c11b8f130c)

# Conflicts:
#	muted-tests.yml
2025-04-12 01:56:57 +10:00
Nhat Nguyen
47bda42e28
[8.18] ESQL: Ensure non-zero row size in EstimatesRowSize (#122762) (#123957)
* ESQL: Ensure non-zero row size in `EstimatesRowSize` (#122762)

Closes #121535

* Removed getFirest() usages

---------

Co-authored-by: kanoshiou <73424326+kanoshiou@users.noreply.github.com>
Co-authored-by: Costin Leau <costin@users.noreply.github.com>
Co-authored-by: Iván Cea Fontenla <ivancea96@outlook.com>
Co-authored-by: Iván Cea Fontenla <ivan.cea@elastic.co>
2025-04-12 01:52:25 +10:00
Aurélien FOUCRET
0edabdb88d
Fix LTR rescorer with model alias (#126273) (#126655) 2025-04-11 18:20:47 +10:00
Patrick Doyle
3b55e27891
Fix inference plugin name in entitlements warning suppression (#126470) (#126488) 2025-04-09 05:03:21 +10:00
Alexander Spies
c99983e97b
ESQL: Fix usage of already released null block in ValueSourceReaderOperator (#126411) (#126474)
* Add yaml test with reproducer
* Fix the bug
* Make ComputeBlockLoaderFactory Releasable
2025-04-09 02:27:17 +10:00
Slobodan Adamović
dbdaf169e1
Set keyUsage for generated HTTP certificates and self-signed CA (#126376) (#126448) (#126453)
* Set `keyUsage` for generated HTTP certificates and self-signed CA (#126376)

The `elasticsearch-certutil http` command, and security auto-configuration,
generate the HTTP certificate and CA without setting the `keyUsage` extension.

This PR fixes this by setting (by default):
- `keyCertSign` and `cRLSign` for self-signed CAs
- `digitalSignature` and `keyEncipherment` for HTTP certificates and CSRs

These defaults can be overridden when running `elasticsearch-certutil http`
command. The user will be prompted to change them as they wish.

For `elasticsearch-certutil ca`, the default value can be overridden by passing
the `--keysage` option, e.g.
```
elasticsearch-certutil ca --keyusage "digitalSignature,keyCertSign,cRLSign" -pem
```

Fixes #117769

(cherry picked from commit 284121ad9f)

# Conflicts:
#	docs/reference/elasticsearch/command-line-tools/certutil.md

* fix compilation error

* [CI] Auto commit changes from spotless

* fix failing test

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-04-08 22:02:06 +10:00
Mike Pellegrini
947d38a04f
Update InferenceException to retain top-level message (#126345) (#126403) 2025-04-08 00:18:42 +10:00
Brian Seeders
e5c2b1f1b7
Fix vector-tile tests when run on non-snapshot builds (#126251) (#126329)
(cherry picked from commit eaac8ee36c)
2025-04-04 17:47:56 -04:00
Jan Kuipers
c8734790e4
Fix deploying custom models with adaptive allocations (#126276) (#126315) 2025-04-05 03:00:58 +11:00
Ben Chaplin
a305288410
[8.18] Log stack traces on data nodes before they are cleared for transport (#125732) (#126246)
* Log stack traces on data nodes before they are cleared for transport (#125732)

We recently cleared stack traces on data nodes before transport back to the coordinating node 
when error_trace=false to reduce unnecessary data transfer and memory on the coordinating 
node (#118266). However, all logging of exceptions happens on the coordinating node, so stack 
traces disappeared from any logs. This change logs stack traces directly on the data node when 
error_trace=false.

(cherry picked from commit 9f6eb1d4e3)
2025-04-04 11:44:38 -04:00
Kathleen DeRusso
ccb530e009
Ensure sentence overlap is considered in SentenceBoundaryChunkingSettings equals/hashCode (#126250) (#126291) 2025-04-05 01:40:14 +11:00
Richard Dennehy
5e592e05e7
Fix NPE for missing Content Type header in OIDC Authenticator (#126191) (#126202)
* Fix NPE for missing Content Type header in OIDC Authenticator

* Update docs/changelog/126191.yaml
2025-04-04 00:02:28 +11:00
Alexander Spies
96ca13aaee
[8.18] ESQL: ESQL: Fix ReplaceMissingFieldsWithNull (#125764) (#126166)
* Revert changes to Layout.java

The change in 80125a4bac is a quick fix
and allows breaking an invariant of Layout. Revert that.

* Simplify ReplaceMissingFieldWithNull

When encountering projections, it tries to do the job of field
extraction for missing fields by injecting an Eval that creates a
literal null with the same name id as the field attribute for the
missing field. This is wrong:
1. We only insert an Eval in case that a Project relies on the missing
   attribute. There could be other plan nodes that rely on the missing
   attribute.
2. Even for Projects, we only insert an Eval in case we squarely project
   for the field - in case of aliases (e.g. from RENAME), we do nothing.
3. In case of multiple Projects that use this attribute, we create
   multiple attributes with the original field attribute's id, causing
   a wrong Layout. This triggered
   https://github.com/elastic/elasticsearch/issues/121754.

* Revive logic for EsRelation instead of Project

* Update LocalLogicalPlanOptimizerTests

* Update test expectations

* Do not prune attributes from EsRelation

This can lead to empty output, which leads to the EsRelation being
replaced by a LocalRelation with 0 rows.

* Add tests + capability

* Add comments

* [CI] Auto commit changes from spotless

* Update docs/changelog/125764.yaml

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-04-03 09:10:15 +02:00
Luke Whiting
f80d6defeb
ES-125727 Fix for [CI] ReindexDataStreamTransportActionIT testAlreadyUpToDateDataStream failing (#126123) (#126136)
(cherry picked from commit d816845251)

# Conflicts:
#	muted-tests.yml
2025-04-03 02:53:19 +11:00
Jack Conradson
e82f589132
Backport: Add exclusive file entitlement for settings (#125272) (#126006) (#126059) (#126067) 2025-04-02 06:58:39 +11:00
Mark Vieira
300893b2da
Convert CCR module tests to new testing framework (#125894) (#125998)
(cherry picked from commit 66ba3c2a53)

# Conflicts:
#	x-pack/plugin/ccr/qa/build.gradle
#	x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle
#	x-pack/plugin/ccr/qa/multi-cluster/build.gradle
#	x-pack/plugin/ccr/src/javaRestTest/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java
2025-04-01 09:28:46 +11:00
Mark Vieira
3c9addeb2d
[8.18] Convert more x-pack modules to new test framework (#125874) (#125993) 2025-03-31 14:15:36 -07:00
Mark Vieira
fa9f0f4bda
[8.18] Convert x-pack fleet project to new test framework (#125743) (#125979)
* Convert x-pack fleet project to new test framework (#125743)

(cherry picked from commit e75891e49a)

# Conflicts:
#	x-pack/plugin/fleet/qa/rest/build.gradle
#	x-pack/plugin/fleet/qa/rest/src/yamlRestTest/resources/roles.yml
#	x-pack/plugin/fleet/roles.yml
#	x-pack/plugin/fleet/src/yamlRestTest/java/org/elasticsearch/xpack/fleet/FleetRestIT.java
#	x-pack/plugin/fleet/src/yamlRestTest/resources/roles.yml

* [CI] Auto commit changes from spotless

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-04-01 06:26:26 +11:00
Mark Tozzi
95e26a4e49
Lower logging level (#125940) (#125953)
In #125595 I accidentally left some logging at WARN level; this PR corrects that to TRACE.
2025-04-01 02:13:01 +11:00
Niels Bauman
6dfab8df46
Fix some yamlRestTestV7CompatTest tests (#125682) (#125949)
The V7 REST compat tests shouldn't run with queryable built-in roles
enabled.

Relates #120323

Fixes #121501
Fixes #122226
Fixes #122687
Fixes #123081
Fixes #123147

(cherry picked from commit a3b9b98b51)

# Conflicts:
#	muted-tests.yml
2025-04-01 01:56:13 +11:00
Dimitris Rempapis
b2e939f94f
[8.x] Support 7x segments as archive in 8x / 9x (#125389) (#125919)
Support 7x segments as archive in 8x / 9x - backport to 8.x
2025-03-31 20:09:33 +11:00
Mark Vieira
cfff9628c4
Fix typo in build script 2025-03-28 15:51:45 -07:00
Mark Vieira
4f4527b039
Fix enterprise search yaml rest compatibility test
(cherry picked from commit de119e4a55)
2025-03-28 15:43:56 -07:00
Mark Vieira
b0ef9bc79c
[8.18] Convert enterprise search module to new testing framework (#125807) (#125879)
* Convert enterprise search module to new testing framework (#125807)

(cherry picked from commit 3ac0c136aa)

# Conflicts:
#	x-pack/plugin/ent-search/qa/rest/build.gradle

* Fix task name
2025-03-29 05:52:42 +11:00
Craig Taverner
fa0db81652
[8.x] Add integration tests that verify ST_EXTENT_AGG needs a license (#125584) (#125712) (#125719) (#125834)
* Add integration tests that verify ST_EXTENT_AGG needs a license (#125584) (#125712)

* Fix java version problem on backport

* Use PLATINUM as license level for spatial features
2025-03-28 22:27:54 +11:00
Mark Vieira
dc62cd476c
Migrate x-pack core module to new testing framework (#125740) (#125799) 2025-03-28 05:24:43 +11:00
David Kyle
592e681775
[ML] Check if the anomaly results index has been rolled over (#125404)
If the v7 index has already been rolled over don't try again
2025-03-27 17:15:48 +02:00
Mary Gouseti
e2b7bdb049
Fix p0=deprecation/10_basic/Test Deprecations (#125687) (#125768)
In #120505 we introduced a capabilities check in the yaml test `deprecation/10_basic/Test Deprecations` but we forgot to add them in the `RestDeprecationInfoAction`.

In this PR we add the capabilities which will enable the test and we make the test resilient to the warning that occurs when the `.security-7` index is present.
2025-03-28 00:10:36 +11:00
Benjamin Trent
96def2843f
Return appropriate error on null dims update instead of npe (#125716) (#125767)
Calling `Object::toString` was trying to call `null.toString()`, really
it should have been `Objects::toString`, which accepts `null`.

closes: https://github.com/elastic/elasticsearch/issues/125713
(cherry picked from commit dd58b0b6fa)
2025-03-27 23:48:36 +11:00
Armin Braun
0296f7f935
Load FieldInfos from store if not yet initialised through a refresh on IndexShard (#125650) (#125762)
Load field caps from store if they haven't been initialised through a refresh yet.
Keep the plain reads to not mess with performance characteristics too much on the good path but protect against confusing races when loading field infos now (that probably should have been ordered stores in the first place but this was safe due to other locks/volatiles on the refresh path).

Closes #125483
2025-03-27 13:20:41 +01:00
Fang Xing
5c1e17c51b
[ES|QL] Make numberOfChannels consistent with layout map by removing duplicated ChannelSet (#125636) (#125721)
* make numberOfChannels consistent with layout

(cherry picked from commit 80125a4bac)

# Conflicts:
#	x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
2025-03-27 08:53:29 +11:00
Stanislav Malyshev
a368b41ca7
[8.18] Handle long overflow in dates (#124048) (#125697)
* Handle long overflow in dates (#124048)

* Handle long overflow in dates

(cherry picked from commit 07921a78a6)

# Conflicts:
#	rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/500_date_range.yml
#	server/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java
#	server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java

* Add import
2025-03-27 05:34:59 +11:00
Mark Tozzi
25d9c20cbc
Esql - Fix lucene push down behavior when a range contains nanos and millis (#125595) (#125618)
Follow up to #125345. If the query contained both a nanos and a millis comparison, we were formatting the dates incorrectly for the lucene push down. This PR adds a test and a fix for that case.
---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-03-26 07:34:32 +11:00
Valeriy Khakhutskyy
55476abc9a
[ML] Increasing timeout for DFA integration tests #125510 (#125571)
Increase waiting time to prevent DFA integration tests from timing out.
2025-03-25 21:56:45 +11:00
Mark Tozzi
f7d6a78726
ESQL - date nanos range bug? (#125345) (#125540)
Fixes #125439

We were incorrectly formatting nanosecond dates when building lucene queries. We had missed this in our testing because none of the CSV tests were running against Lucene. This happened because the date nanos test data includes multivalue fields. Our warning behavior for multivalue fields is inconsistent between queries run in Lucene and queries run in pure ES|QL without pushdown. Our warning tests, however, require that the specified warnings be present in all execution paths. When we first built the date nanos CSV tests, we worked around this by always using an MV function to unpack the multivalue fields. But we forgot that using an MV function prevents the entire query from being pushed down to Lucene, and thus that path wasn't being tested.

In this PR, I've duplicated many of the tests to have a version that doesn't use the MV function, and uses warningRegex instead of warning. The regex version does not fail if the header is absent, so it's safe to use in both modes. Rewriting the tests this way revealed several situations in which this bug can manifest, all of which are fixed in this PR. I cannot be confidant that there aren't more paths that can trigger this bug and aren't covered by these tests, but I haven't found any yet.

I've left some trace level logging that I found helpful while debugging this.

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-03-25 10:38:28 +11:00
Dan Rubinstein
fde490fe44
Fix AlibabaCloudSearchCompletionAction not accepting ChatCompletionInputs (#125023) (#125416)
* Fix AlibabaCloudSearchCompletionAction not accepting ChatCompletionInputs

* Update docs/changelog/125023.yaml

* Fix unit tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-24 11:06:08 -04:00
Jim Ferenczi
8256aaaff1
Set default similarity for Cohere model to cosine (#125370) (#125428)
Cohere embeddings are expected to be normalized to unit vectors, but due to floating point precision issues,
our check ({@link DenseVectorFieldMapper#isNotUnitVector(float)}) often fails.
This change fixes this bug by setting the default similarity for newly created Cohere inference endpoint to cosine.

Closes #122878
2025-03-22 05:38:55 +11:00
Carlos Delgado
a259503b39
ES|QL: Add default values for match function options (#125282) (#125411)
(cherry picked from commit 160ac698d7)

# Conflicts:
#	docs/reference/query-languages/esql/_snippets/functions/functionNamedParams/match.md
2025-03-22 03:01:14 +11:00
Jan Kuipers
9a5aa158d1
Don't immediately scale down startups triggered by non-master nodes in inference adaptive allocations. (#125297) (#125373) (#125391) 2025-03-21 23:35:19 +11:00
Mark Vieira
1aeda50c9b
Skip upgrade test against bugged older versions (#125241) 2025-03-20 13:03:25 -07:00
Keith Massey
c427bd7a6a
Reindex data stream indices on different nodes (#125171) (#125335)
(cherry picked from commit 24132d3834)
2025-03-21 05:28:50 +11:00