Commit graph

82736 commits

Author SHA1 Message Date
Ryan Ernst
ccd2a0f28b
Remove unnecessary network entitlements from server (#126799) (#126867)
These entitlements should not be necessary. Server does not directly
create any outbound connections, and netty is not a dependency of server
so it should not exist within the server policy.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-19 11:44:33 +10:00
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
Ryan Ernst
4b6e8d9f39
Make sure SM isn't running alongside entitlements tests (#127082) (#127083)
closes #127077
2025-04-19 11:40:51 +10:00
Ryan Ernst
57bb5f32fa
Use Terminal.readSecret in add string keystore command (#126966) (#127068)
As a followon to #126729, the add string keystore command doesn't need
to use a reader at all (and it was incorrect for it to close the reader
from the terminal). Instead, the Terminal abstraction already handles
how to get at line by line secrets. This commit removes that usage of
reader and uses readSecret calls instead.

closes #126882
2025-04-19 05:04:11 +10:00
elasticsearchmachine
6c7d3a7f93 Mute org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT testSearchWithRandomDisconnects #122707 2025-04-19 01:25:30 +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
Brian Seeders
f92f63206c
Revert "Bump versions after 8.18.0 release"
This reverts commit bc9cc7b08b.
2025-04-16 19:02:46 -04: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
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
Nik Everett
2d2a3a21df
ESQL: Create fewer documents in lookup tests (#126874) (#126878)
This lowers the number of documents used to test lookup because we have
a few failures over the last few months. These are all cases that we
expect to *pass* so fewer documents should make them even more likely to
pass.

Closes #125913 Closes #125779
2025-04-17 08:10:07 +10:00
elasticsearchmachine
bc9cc7b08b Bump versions after 8.18.0 release 2025-04-16 21:45:45 +00:00
Brian Seeders
651d4b8792
Revert "Bump versions after 8.18.0 release"
This reverts commit 9c46fef3d9.
2025-04-16 17:30:10 -04:00
elasticsearchmachine
9c46fef3d9 Bump versions after 8.18.0 release 2025-04-16 21:11:31 +00:00
elasticsearchmachine
925c926dc7 Prune changelogs after 8.18.0 release 2025-04-16 20:43:47 +00:00
elasticsearchmachine
ee88e04e97 Bump versions after 8.18.0 release 2025-04-16 20:43:10 +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
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
Brian Seeders
2e00fb8147
Update branches.json 2025-04-15 12:42:17 -04:00
Brian Seeders
ebc5db2f9a
Update branches.json 2025-04-15 12:41:52 -04:00
elasticsearchmachine
d3798e1ee6 Prune changelogs after 8.17.5 release 2025-04-15 14:49:00 +00:00
elasticsearchmachine
6fc905ce55 Bump versions after 8.17.5 release 2025-04-15 14:47:42 +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
Jan Kuipers
a563c9176e
License check for ES|QL categorize (#126595) (#126835) 2025-04-15 21:46:13 +10: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
Patrick Doyle
2af113d78f
Fix RepositoriesFileSettingsIT to wait for metadataVersion (#126720) (#126728) (#126781) 2025-04-15 01:14:18 +10: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
Patrick Doyle
7682186455
Reword Suppress a Benign Warning section (#126546) (#126721) 2025-04-12 06:05:58 +10:00
Martijn van Groningen
8c439ffc72
[8.18] Allow a tsdb data stream to rolled over to a logsdb data stream (#126714)
* [8.18] Allow a tsdb data stream to rolled over to a logsdb data stream
and the other way around.

Backporting #126640 to 8.18 branch.

This doesn't make much sense. However, if a data stream's index mode differs from the index mode of most recent backing index, then this can cause confusion. Typically, misconfiguration is a reason this can happen.

Related to #126637

* fix test compile issue
2025-04-12 05:50:12 +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
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
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
Quentin Pradet
58b665ce3a
Add back inference.inference API (#126601) (#126672) 2025-04-11 21:20:05 +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
Quentin Pradet
04af7c8140
Remove reference to dropped EIS API (#126422) (#126513)
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
(cherry picked from commit 5f871c5cf5)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-04-10 16:35:47 +04:00
Ryan Ernst
04e979aa50
Simplify entitlement rest test discovery (#125449) (#126539)
This commit cleans up how entitlement test methods are discovered. It
also adds another robustness check to ensure an annotation doesn't exist
on a private method.
2025-04-10 01:55:06 +10:00
Mariusz Józala
abe20f253d
[CI] Use official UBI9 image for testing (#126455) (#126504)
Internal UBI images from `docker.elastic.co` are planned to be removed.
2025-04-09 18:44:22 +10:00