Commit graph

17630 commits

Author SHA1 Message Date
Ryan Ernst
4aedc24ff3
Workaround max name limit imposed by Jackson 2.17 (#126806) (#126870)
In Jackson 2.15 a maximum string length of 50k characters was
introduced. We worked around that by override the length to max int on
all parsers created by xcontent. Jackson 2.17 introduced a similar limit
on field names. This commit mimics the workaround for string length by
overriding the max name length to be unlimited.

relates #58952

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-19 11:41:05 +10:00
Lorenzo Dematté
591a08f506
[Entitlements] Validation checks on paths (#126852) (#127055)
With this PR we restrict the paths we allow access to, forbidding plugins to specify/request entitlements for reading or writing to specific protected directories.

I added this validation to EntitlementInitialization, as I wanted to fail fast and this is the earliest occurrence where we have all we need: PathLookup to resolve relative paths, policies (for plugins, server, agents) and the Paths for the specific directories we want to protect.

Relates to ES-10918
2025-04-19 00:44:49 +10:00
Ryan Ernst
24b4966b2c
Fix uniquify to handle multiple successive duplicates (#126889) (#126951)
CollectionUtils.uniquify is based on C++ std::unique. However, C++
iterators are not quite the same as Java iterators. In particular,
advancing them only allows grabbing the value once. This commit reworks
uniquify to be based on list indices instead of iterators.

closes #126883

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-18 07:05:21 +10:00
elasticsearchmachine
b111bf6d5e
Forward port release notes for v8.17.5 (#127020)
* Forward port release notes for v8.17.5

* delete 8.18.1 includes

---------

Co-authored-by: Liam Thompson <leemthompo@gmail.com>
2025-04-17 18:40:50 +02:00
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
elasticsearchmachine
bb66b3ace6 Finalize release notes for v8.18.0 2025-04-18 01:32:18 +10:00
Samiul Monir
080aaef717
Updating documentation for text_similarity_reranker for 8.x (#126971) (#127007)
* Updating documentation of text_similarity_reranker for 8.x

* updating documentation to remove duplicate and redundant wording
2025-04-18 01:23:25 +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
Lorenzo Dematté
604df82e6d
Fix vec_caps to test for OS support too (on x64) (#126911) (#126922)
On x64, we are testing if we support vector capabilities (1 = "basic" = AVX2, 2 = "advanced" = AVX-512) in order to enable and choose a native implementation for some vector functions, using CPUID.

However, under some circumstances, this is not sufficient: the OS on which we are running also needs to support AVX/AVX2 etc; basically, it needs to acknowledge it knows about the additional register and that it is able to handle them e.g. in context switches. To do that we need to a) test if the CPU has xsave feature and b) use the xgetbv to test if the OS set it (declaring it supports AVX/AVX2/etc).

In most cases this is not needed, as all modern OSes do that, but for some virtualized situations (hypervisors, emulators, etc.) all the component along the chain must support it, and in some cases this is not a given.

This PR introduces a change to the x64 version of vec_caps to check for OS support too, and a warning on the Java side in case the CPU supports vector capabilities but those are not enabled at OS level.

Tested by passing noxsave to my linux box kernel boot options, and ensuring that the avx flags "disappear" from /proc/cpuinfo, and we fall back to the "no native vector" case.

Fixes #126809
2025-04-17 18:22:17 +10:00
Ryan Ernst
963361cd35
Use terminal reader in keystore add command (#126729) (#126965)
When reading a string value from stdin the keystore add command
currently looks directly at stdin. However, stdin may also be consumed
while reading the keystore password. This commit changes the add command
to use the reader from the termainl instead of looking at stdin
directly.

closes #98115
2025-04-17 08:39:16 +10:00
elasticsearchmachine
925c926dc7 Prune changelogs after 8.18.0 release 2025-04-16 20:43:47 +00:00
Liam Thompson
9d6ef1f166
[DOCS] [8.x] Update esql-lookup-join.md to mention index mode requirement (#126905)
Part of for #126897

8.x equivalent of https://github.com/elastic/elasticsearch/pull/126901/files
2025-04-16 12:41:53 +02:00
elasticsearchmachine
d3798e1ee6 Prune changelogs after 8.17.5 release 2025-04-15 14:49:00 +00: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
Artem Shelkovnikov
ee60142cbf
Document known limitation for Salesforce connector #9545 (#126791) (#126824) 2025-04-15 19:10:44 +10:00
elasticsearchmachine
e6a340bbb8
Add release notes for v8.18.0 release (#126735)
* Update docs for v8.18.0 release

* Update docs/reference/release-notes/highlights.asciidoc

* Don't lose nice edits, just add net new stuff

* revert highlights to edited version

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-04-15 10:38:34 +02:00
Liam Thompson
88b93fc7d2
[Backport][8.18] ESQL: Known issue enrich missing field (#126701) (#126764)
* ESQL: Known issue enrich missing field (#126701)

* Add known issue note to 8.17.0-8.17.4

* Add known issue to 8.16.0-8.16.6

* remove coming tags from notes that hadn't been forward ported to 8.x

* remove another coming tag

* clarify it's esql

* include pages that hadn't been forward ported

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
Co-authored-by: Liam Thompson <leemthompo@gmail.com>
(cherry picked from commit f7a52054b2)

* delete conflict markers on new files to this branch

---------

Co-authored-by: Alexander Spies <alexander.spies@elastic.co>
2025-04-14 19:30:00 +10:00
David Turner
d04357ba98
Fix race condition in RestCancellableNodeClient (#126686) (#126696)
Today we rely on registering the channel after registering the task to
be cancelled to ensure that the task is cancelled even if the channel is
closed concurrently. However the client may already have processed a
cancellable request on the channel and therefore this mechanism doesn't
work. With this change we make sure not to register another task after
draining the registrations in order to cancel them.

Closes #88201
2025-04-12 02:09:05 +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
Liam Thompson
cc1ed4f8c4
[DOCS] 8.x mention categorize license requirement (#126670) 2025-04-11 16:01:54 +02:00
Martijn van Groningen
af53aadbaf
[8.18] Improve resiliency of UpdateTimeSeriesRangeService (#126680)
Backporting #126637 to 8.18 branch.

If updating the `index.time_series.end_time` fails for one data stream,
then UpdateTimeSeriesRangeService should continue updating this setting for other data streams.

The following error was observed in the wild:

```
[2025-04-07T08:50:39,698][WARN ][o.e.d.UpdateTimeSeriesRangeService] [node-01] failed to update tsdb data stream end times
java.lang.IllegalArgumentException: [index.time_series.end_time] requires [index.mode=time_series]
        at org.elasticsearch.index.IndexSettings$1.validate(IndexSettings.java:636) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.index.IndexSettings$1.validate(IndexSettings.java:619) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.common.settings.Setting.get(Setting.java:563) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.common.settings.Setting.get(Setting.java:535) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.datastreams.UpdateTimeSeriesRangeService.updateTimeSeriesTemporalRange(UpdateTimeSeriesRangeService.java:111) ~[?:?]
        at org.elasticsearch.datastreams.UpdateTimeSeriesRangeService$UpdateTimeSeriesExecutor.execute(UpdateTimeSeriesRangeService.java:210) ~[?:?]
        at org.elasticsearch.cluster.service.MasterService.innerExecuteTasks(MasterService.java:1075) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:1038) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.cluster.service.MasterService.executeAndPublishBatch(MasterService.java:245) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.cluster.service.MasterService$BatchingTaskQueue$Processor.lambda$run$2(MasterService.java:1691) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.action.ActionListener.run(ActionListener.java:452) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.cluster.service.MasterService$BatchingTaskQueue$Processor.run(MasterService.java:1688) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.cluster.service.MasterService$5.lambda$doRun$0(MasterService.java:1283) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.action.ActionListener.run(ActionListener.java:452) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.cluster.service.MasterService$5.doRun(MasterService.java:1262) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:1023) ~[elasticsearch-8.17.3.jar:?]
        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27) ~[elasticsearch-8.17.3.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1575) ~[?:?]
```

Which resulted in a situation, that causes the `index.time_series.end_time` index setting not being updated for any data stream. This then caused data loss as metrics couldn't be indexed, because no suitable backing index could be resolved:

```
the document timestamp [2025-03-26T15:26:10.000Z] is outside of ranges of currently writable indices [[2025-01-31T07:22:43.000Z,2025-02-15T07:24:06.000Z][2025-02-15T07:24:06.000Z,2025-03-02T07:34:07.000Z][2025-03-02T07:34:07.000Z,2025-03-10T12:45:37.000Z][2025-03-10T12:45:37.000Z,2025-03-10T14:30:37.000Z][2025-03-10T14:30:37.000Z,2025-03-25T12:50:40.000Z][2025-03-25T12:50:40.000Z,2025-03-25T14:35:40.000Z
```
2025-04-11 22:49:23 +10:00
Aurélien FOUCRET
0edabdb88d
Fix LTR rescorer with model alias (#126273) (#126655) 2025-04-11 18:20:47 +10:00
Larisa Motova
0442be3000
Update keyword documentation for logsdb (#126652) (#126661)
This commit adds a note that ignore_above has a different limit for
logsdb indices to the documentation. Also specifies that ignore_above
applies to all types of the keyword family.

Relates https://github.com/elastic/sdh-elasticsearch/issues/8892
2025-04-11 18:17:09 +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
kosabogi
dd68d3d6fb
Adds note on anomaly detection alert behaviour (#126102) (#126444)
* Adds note on anomaly detection alert behaviour

* Fixes attribute

* Relocating the addition

* Fixes based on feedback
2025-04-08 15:59:53 +10:00
István Zoltán Szabó
30baf759bb
[8.x][DOCS] Pulls out EIS-related docs (#126381) (#126423)
* [8.x][DOCS] Pulls out EIS-related docs.

* [DOCS] More edits.
2025-04-08 04:19:07 +10:00
Bogdan Pintea
c066c60050
[8.x] SQL: Docs: Drop examples of LIKE/RLIKE vs QUERY/MATCH equivalence #125970 (#126398)
Backport of #125673
2025-04-07 22:42:31 +10:00
Bogdan Pintea
cf88b888ab
[8.x] ESQL: supplement docs on LIMIT (#125967) (#126395)
Backport of #125839.
2025-04-07 22:10:47 +10:00
elasticsearchmachine
d5948501ae
Add release notes for v8.18.0 release (#126353)
* Update docs for v8.18.0 release

* Clean up 8.18.0 notes

* add missing release notes to 8.18 branch

* Clean up highlights

* Rewrite lookup join highlight

* add esql to highlight heading

---------

Co-authored-by: Liam Thompson <leemthompo@gmail.com>
2025-04-07 09:45:22 +02: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
Stef Nestor
632bd7382f
Backport docs-content#962 (#126242) (#126249)
* Backport docs-content#962

---------

Co-authored-by: Lisa Cawley <lcawley@elastic.co>
2025-04-04 07:46:00 +11:00
István Zoltán Szabó
144e00104a
[8.x][DOCS] Fixes typo on built-in role page. (#126211) (#126217) 2025-04-04 00:53:21 +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
Keith Massey
57adbdadad
Preventing ConcurrentModificationException when updating settings for more than one index (#126077) (#126129) 2025-04-02 16:20:52 -05:00
Joe Gallo
772681acbe
[8.18] Minor docs fixes (#126144) (#126152) 2025-04-02 13:03:24 -04:00
Luca Cavanna
bc4d7ebb00
Re-enable parallel collection for field sorted top hits (#125916) (#126011)
With #123610 we disabled parallel collection for field and script sorted top hits,
aligning its behaviour with that of top level search. This was mainly to work around
a bug in script sorting that did not support inter-segment concurrency.

The bug with script sort has been fixed with #123757 and concurrency re-enabled for it.

While sort by field is not optimized for search concurrency, top hits benefits from it
and disabling concurrency for sort by field in top hits has caused performance
regressions in our nightly benchmarks.

This commit re-enables concurrency for top hits with sort by field is used. This
introduces back a discrepancy between top level search and top hits, in that concurrency
is applied for top hits despite sort by field normally disables it. The key difference
is the context where sorting is applied, and the fact that concurrency is disabled
only for performance reasons on top level searches and not for functional reasons.
2025-04-01 19:45:35 +11:00
Liam Thompson
08ebc014aa
[8.x] Update esql-for-search.asciidoc (#125929)
Uncomment links to ESQL search tutorial
2025-03-31 15:46:34 +02:00
Luke Whiting
627f8c91b8
Update missed documentation change for new watcher index settings (#125758) (#125925)
* Update missed documentation change for new watcher index settings

* Update docs/reference/rest-api/watcher/update-settings.asciidoc



---------

Co-authored-by: Keith Massey <keith.massey@elastic.co>
2025-03-31 20:55:33 +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
Charlotte Hoblik
b7a238af60
8.18.0 Connectors release notes (#125761) (#125853) 2025-03-29 01:54:32 +11:00
Carlos Delgado
51b715f2bc
[8.18] Non existing synonyms sets do not fail shard recovery (#125659) (#125796) 2025-03-28 07:39:43 +01:00
Alexander Spies
a2e2337ad1
[8.x] ESQL: Improve LOOKUP JOIN page (#125688) (#125797)
Some minor edits, formatting improvements etc.

(cherry picked from commit 3536c6d110)
2025-03-28 04:19:53 +11:00
shainaraskas
a99453cce2
anchor addition for xlink (#125787) 2025-03-27 17:50:48 +01: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
Liam Thompson
cc676a0b3c
[DOCS][8.x] ESQL for search updates (#125759) (#125772)
* [DOCS][8.x] ESQL for search updates

(cherry picked from commit b964982cd4)

# Conflicts:
#	docs/reference/search/search-your-data/semantic-text-hybrid-search
2025-03-28 00:49:55 +11:00