Commit graph

86151 commits

Author SHA1 Message Date
Dan Rubinstein
44507cce04
Fix ELAND endpoints not updating dimensions (#126537)
* Fix ELAND endpoints not updating dimensions

* Update docs/changelog/126537.yaml
2025-04-09 12:16:06 -04:00
Luke Whiting
7d7fa766c5
Batch ILM policy cluster state updates [#122917] (#126529)
* Use a task queue to ensure ILM policy change cluster state updates are batched

* Update docs/changelog/126529.yaml

* Update docs/changelog/126529.yaml

* Switch to using SimpleBatchedAckListenerTaskExecutor

* Get timeout from request

* Ditch the try-catch
2025-04-09 17:09:24 +01:00
Nhat Nguyen
7c77ead209
Remove time unit from rate aggregation (#126497)
Currently, the rate aggregation accepts two parameters: the first 
specifies the counter field, and the second specifies the time unit of 
the rate. The time unit parameter was introduced to conveniently compute 
requests per minute or per hour. However, this can be replaced easily -
for example, rate(field, 1minute) with 60 * rate(field).

This change removes the time unit parameter and reserves it for 
potential future usage, such as introducing a sliding window unit. If we 
decide on other options later, we can reintroduce it. Removing it now
avoids breaking changes while the rate aggregation is not yet available.
2025-04-09 07:49:31 -07:00
Ryan Ernst
2986d738c6
Simplify entitlement rest test discovery (#125449)
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-09 07:24:17 -07:00
Ryan Ernst
3bac50e818
Use logs dir as working directory (#124966)
In the unexpected case that Elasticsearch dies due to a segfault or
other similar native issue, a core dump is useful in diagnosing the
problem. Yet core dumps are written to the working directory, which is
read-only for most installations of Elasticsearch. This commit changes
the working directory to the logs dir which should always be writeable.
2025-04-09 07:07:11 -07:00
Mayya Sharipova
d82886fc52
Enable sort optimization on float and half_float (#126342)
Before we enabled sort optimization on long, double and date types,
but left other types for follow-up.

This enables sort optimization on float and half_float types.

Optimizations on INT, BYTE, SHORT are left for follow-up,
because they need more work: we currently use SORT.LONG
type for all integer types and this doesn't allow to use
optimization.
2025-04-09 09:07:35 -04:00
Aurélien FOUCRET
20ae83f603
[ES|QL] Rerank command: unmute reranker tests in multi-node. (#126521) 2025-04-09 13:30:22 +02:00
Iván Cea Fontenla
90dcccfc96
ESQL: Updated RENAME docs with the behaviour of multiple column renames (#126462)
* ESQL: Updated RENAME docs with the behaviour of multiple column renames

* Added rename example to csv-spec
2025-04-09 12:39:10 +02:00
Luigi Dell'Aquila
41297680c7
ES|QL: generative tests - fix identifiers generation and source field mapping (#126514) 2025-04-09 12:25:09 +02:00
Lorenzo Dematté
b692d1a14e
Add support for a custom transport version check predicate in ElasticsearchException (#126272)
Today when we are adding a ElasticsearchException, we specify a versionAdded TransportVersion (the transport version from which we support it); this version is checked by the isRegistered method:

return version.onOrAfter(elasticsearchExceptionHandle.versionAdded);

This does not play well with backports; when we add a patch version for a backport, normally the procedure would be to change the code above take also the patch into account, like:

version.orOnAfter(versionAdded) || version.isPatchFrom(versionPatched)

This PR updates ElasticsearchException to have more than just "version added", so that we can do patches as described above.
2025-04-09 11:44:39 +02:00
Aurélien FOUCRET
26ae289648
Fix reranker tests (#126500) 2025-04-09 11:20:50 +02:00
Armin Braun
595ba6bb68
Remove some redundant ref-counting from SearchHits (#124948)
Remove ref-counting that is obviously redundant because of clear
ownership transfers from `SearchHits`.
2025-04-09 11:06:48 +02:00
Josh Mock
5f871c5cf5
Remove reference to dropped EIS API (#126422)
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
2025-04-09 12:06:00 +04:00
Johannes Fredén
e22fff9d81
Unmute testWatcherWithApiKey (#126502)
Resolves: https://github.com/elastic/elasticsearch/issues/124159
2025-04-09 18:01:03 +10:00
elasticsearchmachine
e090e475c0 Mute org.elasticsearch.smoketest.MlWithSecurityIT test {yaml=ml/get_trained_model_stats/Test get stats given trained models} #126510 2025-04-09 17:43:14 +10:00
Ievgen Degtiarenko
e95397c829
Speedup equals (#126394) 2025-04-09 09:36:47 +02:00
Mariusz Józala
afe503f02f
[CI] Use official UBI9 image for testing (#126455)
Internal UBI images from `docker.elastic.co` are planned to be removed.
2025-04-09 09:05:26 +02:00
Martijn van Groningen
065c5830cb
First step optimizing tsdb doc values codec merging. (#125403)
The doc values codec iterates a few times over the doc value instance that needs to be written to disk. In case when merging and index sorting is enabled, this is much more expensive, as each time the doc values instance is iterated a merge sorting is performed (in order to get the doc ids of new segment in order of index sorting).

There are several reasons why the doc value instance is iterated multiple times:
* To compute stats (num values, number of docs with value) required for writing values to disk.
* To write bitset that indicate which documents have a value. (indexed disi, jump table)
* To write the actual values to disk.
* To write the addresses to disk (in case docs have multiple values)

This applies for numeric doc values, but also for the ordinals of sorted (set) doc values.

This PR addresses solving the first reason why doc value instance needs to be iterated. This is done only when in case of merging and when the segments to be merged with are also of type es87 doc values, codec version is the same and there are no deletes. Note this optimized merged is behind a feature flag for now.
2025-04-09 07:50:16 +02:00
Yang Wang
4f9bfb0a3c
[Test] More reliable wait for index to appear (#126437)
Relates: #125652 Resolves: #126204
2025-04-09 14:31:01 +10:00
David Kyle
d2be03c946
[ML] Move Inference Service request and response classes into service package (#126482) 2025-04-08 23:26:25 +02:00
elasticsearchmachine
ebaa807363 Mute org.elasticsearch.xpack.search.AsyncSearchErrorTraceIT testDataNodeLogsStackTraceWhenErrorTraceFalseOrEmpty #126357 2025-04-09 07:21:55 +10:00
elasticsearchmachine
81c544cae9 Mute org.elasticsearch.xpack.downsample.ILMDownsampleDisruptionIT testILMDownsampleRollingRestart #126495 2025-04-09 07:19:01 +10:00
Gal Lalouche
953b9fbb83
ESQL: List/get query API (#124832)
This PR adds two new REST endpoints, for listing queries and getting information on a current query.

* Resolves #124827 
* Related to #124828 (initial work)

Changes from the API specified in the above issues:
* The get API is pretty initial, as we don't have a way of fetching the memory used or number of rows processed.

List queries response:
```
GET /_query/queries
// returns for each of the running queries
// query_id, start_time, running_time, query

{ "queries" : {
 "abc": {
  "id": "abc",
  "start_time_millis": 14585858875292,
  "running_time_nanos": 762794,
  "query": "FROM logs* | STATS BY hostname"
  },
 "4321": {
  "id":"4321",
  "start_time_millis": 14585858823573,
  "running_time_nanos": 90231,
  "query": "FROM orders | LOOKUP country_code ON country"
  }
 } 
}
```

Get query response:
```
GET /_query/queries/abc

{
 "id" : "abc",
  "start_time_millis": 14585858875292,
  "running_time_nanos": 762794,
  "query": "FROM logs* | STATS BY hostname"
  "coordinating_node": "oTUltX4IQMOUUVeiohTt8A"
  "data_nodes" : [ "DwrYwfytxthse49X4", "i5msnbUyWlpe86e7"]
}
```
2025-04-08 22:21:32 +03:00
Stanislav Malyshev
b21e3253a8
Refactor remote cluster handling in Analyzer (#126426)
* Refactor remote cluster handling in Analyzer

- Initialize clusters earlier
- Simplify cluster set calculation
- No need to keep separate skipped list for enrich resolution
2025-04-08 13:20:33 -06:00
Alexey Ivanov
ecf9adfc78
[main] System data streams are not being upgraded in the feature migration API (#126409)
This commit adds support for system data streams reindexing. The system data stream migration extends the existing system indices migration task and uses the data stream reindex API.
The system index migration task starts a reindex data stream task and tracks its status every second. Only one system index or system data stream is migrated at a time. If a data stream migration fails, the entire system index migration task will also fail.

Port of #123926
2025-04-08 20:42:58 +02:00
Patrick Doyle
728eb7504f
Fix inference plugin name in entitlements warning suppression (#126470) 2025-04-08 13:58:01 -04:00
David Turner
aab40b1247
Introduce TestBlobContainerBuilder (#126445)
The mostly-optional parameters to `createBlobContainer` are getting
rather numerous in this test harness which makes the tests hard to read.
This commit introduces a builder to help name the provided parameters
and skip the omitted ones.
2025-04-09 01:52:16 +10:00
Joe Gallo
450516d675
Fix a RemoveProcessor test that never ran (#126464) 2025-04-08 11:21:04 -04:00
Alexander Spies
ffd491364c
ESQL: Fix usage of already released null block in ValueSourceReaderOperator (#126411)
* Add yaml test with reproducer
* Fix the bug
* Make ComputeBlockLoaderFactory Releasable
2025-04-08 17:17:57 +02:00
Nhat Nguyen
c1a30659c5
Select time-series indices with TS command (#126436)
With this change, the TS command will target only time_series indexes.
2025-04-08 08:16:14 -07:00
David Turner
94c385d067
Run newShardSnapshotTask tasks concurrently (#126452)
In #88707 we changed the behaviour here to run the shard-snapshot
initialization tasks all in sequence. Yet these tasks do nontrivial work
since they may flush to acquire the relevant index commit, so with this
commit we go back to distributing them across the `SNAPSHOT` pool again.
2025-04-09 01:10:11 +10:00
elasticsearchmachine
2c0b71f99d Mute org.elasticsearch.xpack.security.cli.HttpCertificateCommandTests testGenerateMultipleCertificateWithNewCA #126471 2025-04-09 00:46:21 +10:00
elasticsearchmachine
b83a86e070 Mute org.elasticsearch.xpack.test.rest.XPackRestIT test {p0=transform/transforms_start_stop/Test start/stop only starts/stops specified transform} #126466 2025-04-09 00:07:26 +10:00
Dianna Hohensee
4b2867a0ef
Support maxConnections override in AbstractBlobContainerRetriesTestCase tests (#126435) 2025-04-08 09:55:01 -04:00
Dan Rubinstein
20f6a2a76b
Adding endpoint creation validation to ElasticsearchInternalService (#123044)
* Adding validation to ElasticsearchInternalService

* Update docs/changelog/123044.yaml

* [CI] Auto commit changes from spotless

* Removing checkModelConfig

* Fixing IT

* [CI] Auto commit changes from spotless

* Remove DeepSeek checkModelConfig and fix tests

* Cleaning up comments, updating validation input type, and moving model deployment starting to model validator

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-08 09:53:31 -04:00
Mary Gouseti
060a9b746a
[DLM]Use default lifecycle instance instead of default constructor (#126461)
When creating the an empty lifecycle we used to use the default
constructor. This is not just for efficiency but it will allow us to
separate the default data and failures lifecycle in the future.
2025-04-08 23:37:30 +10:00
elasticsearchmachine
e27bffbc41 Mute org.elasticsearch.ingest.geoip.EnterpriseGeoIpDownloaderIT testEnterpriseDownloaderTask #126124 2025-04-08 23:26:59 +10:00
Pete Gillin
f9b29efc24
Multi-project for TransportExlainLifecycleAction (#126414)
This converts this class to support multi-project.

There is a drive-by refactoring to split multiple independent tests in one method into separate methods. (Look at this change with whitespace changes hidden to see the 'real' change.)
2025-04-08 14:23:35 +01:00
Rene Groeschke
6e4cb8142b
Add initial esql test benchmark tests (#126224)
* Add initial esql test benchmark tests
* Fix build-benchmark pipeline
* Update gredle profiler
2025-04-08 13:28:34 +02:00
Richard Dennehy
ceaa01a538
Add Issuer to failed SAML Signature validation logs when available (#126310)
* Add Issuer to failed SAML Signature validation logs when available

* [CI] Auto commit changes from spotless

* Fix tests

* Update docs/changelog/126310.yaml

* address review comments

* replace String.format call

* update formatIssuer to describeIssuer

* [CI] Auto commit changes from spotless

* truncate long issuers in log messages

* [CI] Auto commit changes from spotless

* handle null issuer value

* address review comments

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-04-08 10:50:45 +01:00
Luca Cavanna
a6ffeeeb71
Remove outdated TODO from TopDocsAndMaxScore (#126386)
There are no plans to remove max_score, as highlighted in #32981 .
This commit removes a related TODO given we don't plan on addressing it.
2025-04-08 10:41:38 +02:00
Luigi Dell'Aquila
262a793329
Re-enable generative tests (#126421) 2025-04-08 10:21:36 +02:00
Ievgen Degtiarenko
c2d0c59b7a
Pre-size collections (#126382) 2025-04-08 10:01:21 +02:00
Slobodan Adamović
284121ad9f
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
2025-04-08 09:44:09 +02:00
Ignacio Vera
47e352fda0
Throw nicer exception in SpanBooleanQueryRewriteWithMaxClause (#126387)
Throw an ElasticsearchStatusException with a RestStatus.BAD_REQUEST code instead of a generic RuntimeException.
2025-04-08 06:42:00 +02:00
Yang Wang
997a7b8fab
FileWatchingService should not throw for missing file (#126264)
Missing file is a valid state for FileWatchingService so that the
exception should be suppressed.
2025-04-08 09:56:35 +10:00
Ryan Ernst
991e80d56e
Remove unnecessary generic params from action classes (#126364)
Transport actions have associated request and response classes. However,
the base type restrictions are not necessary to duplicate when creating
a map of transport actions. Relatedly, the ActionHandler class doesn't
actually need strongly typed action type and classes since they are lost
when shoved into the node client map. This commit removes these type
restrictions and generic parameters.
2025-04-07 16:22:56 -07:00
elasticsearchmachine
9feac7833e Mute org.elasticsearch.smoketest.MlWithSecurityIT test {yaml=ml/trained_model_cat_apis/Test cat trained models} #125750 2025-04-08 07:45:47 +10:00
Nhat Nguyen
6c641c0677
Extrapolate rate aggregation (#126331)
This change performs extrapolation for rate aggregation similarly
to how PromQL does.
2025-04-07 14:31:57 -07:00
Kaarina Tungseth
e3e03bc28b
Removes known issues page content (#126429)
* Removes known issues page

* Adds empty known issues page
2025-04-07 15:58:52 -05:00