Commit graph

86149 commits

Author SHA1 Message Date
Andrei Dan
2f2b9099d8
Add OnlinePrewarming option for cache population reason (#126716) 2025-04-15 02:52:08 +10:00
Jonathan Buttner
31bb3d1619
[ML] Refactoring inference API non-streaming response validation error object check (#126725)
* Refactoring so that non-streaming does not check for error object

* Fixing test
2025-04-14 10:42:40 -04:00
Charlotte Hoblik
8cb449386b
remove redirects.yml (#126774) 2025-04-14 14:10:49 +02:00
Ignacio Vera
ffdfcec334
Upgrade to Lucene 10.2.0 (#126594)
This commit upgrade Elasticsearch to lucene 10.2.0
2025-04-14 13:50:52 +02:00
Mary Gouseti
58a29396a5
Mute test (#126768) 2025-04-14 12:09:24 +03:00
Carlos Delgado
061c8bb8d7
Fix ESQL match test flakiness by using regexes for error messages (#126707) 2025-04-14 10:53:11 +02:00
Kofi B
08beb534ef
[DOCS] Added sort order explanation (#125182)
* Added explanation of sort order and default behavior

* Update docs/reference/elasticsearch/rest-apis/sort-search-results.md

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

---------

Co-authored-by: George Wallace <georgewallace@users.noreply.github.com>
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-04-14 10:28:03 +02:00
Craig Taverner
ec495e9f0b
Make LOOKUP JOIN docs examples fully tested (#126622)
The current LOOKUP JOIN docs include examples that are not tested by the ES|QL tests, unlike most other examples in the documentation. This PR fixes that, changing two examples to use existing tests, and adding a new csv-spec file for the remaining four examples. These four are not required to show results, so the tests have empty data and do not require any results. This means we are testing only the syntax (parsing and semantic analysis), which is sufficient for the docs.
2025-04-14 09:57:58 +02:00
Jan Kuipers
3f2f5ee158
ES|QL change_point docs and tech preview (#126407)
* ES|QL change point docs

* Move ES|QL change_point to tech preview

* Update docs/reference/query-languages/esql/esql-commands.md

Co-authored-by: Craig Taverner <craig@amanzi.com>

* different example + add it the csv tests

* Restructure change_point docs to new structure

* Added generated test examples to change_point docs

* Fixed a few README.md text mistakes and added more details

* fix grammar

* License check

* regen parser

* Update docs/reference/query-languages/esql/_snippets/commands/layout/change_point.md

Co-authored-by: Craig Taverner <craig@amanzi.com>

---------

Co-authored-by: Craig Taverner <craig@amanzi.com>
2025-04-14 09:56:03 +02:00
elasticsearchmachine
411a946b7f Mute org.elasticsearch.xpack.test.rest.XPackRestIT test {p0=transform/transforms_start_stop/Test start/stop/start continuous transform} #126755 2025-04-14 15:42:42 +10:00
elasticsearchmachine
4ed1a000ab Mute org.elasticsearch.repositories.blobstore.testkit.analyze.RepositoryAnalysisFailureIT testFailsOnWriteException #126747 2025-04-13 07:45:29 +10:00
elasticsearchmachine
31b8e36146 Mute org.elasticsearch.xpack.ilm.TimeSeriesDataStreamsIT testShrinkActionInPolicyWithoutHotPhase #126746 2025-04-13 07:31:26 +10:00
Lisa Cawley
ae33eaabdb
[DOCS] Fix broken images (#126648) 2025-04-11 19:04:08 -07:00
Patrick Doyle
4cbc5eb156
Fix test: set up mocks before starting the service (#126719)
* Change testInvalidJSON to set up mocks before starting the service

* Move another mock setup before the service starts
2025-04-11 15:19:53 -07:00
Mikhail Berezovskiy
c8805b85d2
Add flow-control and remove auto-read in netty4 HTTP pipeline (#126441) 2025-04-11 14:54:22 -07:00
Jack Conradson
c1ecafad6a
Fix painless return type cast for list shortcut (#126724)
This fixes an issue where if a Painless getter method return type
 didn't match a Java getter method return type we add a cast. 
Currentlythis is adding an extraneous cast.

Closes: #70682
2025-04-11 13:50:19 -07:00
Oleksandr Kolomiiets
9d18d5280a
Add block loader from stored field and source for ip field (#126644) 2025-04-11 13:37:15 -07:00
Patrick Doyle
5c5a87aba4
Fix RepositoriesFileSettingsIT to wait for metadataVersion (#126720) 2025-04-11 22:00:27 +02:00
Patrick Doyle
448ca02f85
Unmute FileAccessTreeTests.testDuplicatePrunedPaths (#126717) 2025-04-11 12:13:43 -07:00
Patrick Doyle
e4b7b06d1b
Reword Suppress a Benign Warning section (#126546) 2025-04-11 14:51:34 -04:00
Aurélien FOUCRET
3c29593ef6
[ES|QL] COMPLETION command analysis. (#126677)
* [ES|QL] COMPLETION command analysis.

* Moving prompt type test in postAnalysisVerification

* Test lint.
2025-04-11 19:50:26 +02:00
Nik Everett
55a6624746
ESQL: TO_IP can handle leading zeros (#126532)
Modifies TO_IP so it can handle leading `0`s in ipv4s. Here's how it
works now:
```
ROW ip = TO_IP("192.168.0.1") // OK!
ROW ip = TO_IP("192.168.010.1") // Fails
```

This adds
```
ROW ip = TO_IP("192.168.010.1", {"leading_zeros": "octal"})
ROW ip = TO_IP("192.168.010.1", {"leading_zeros": "decimal"})
```

We do this because there isn't a consensus on how to parse leading zeros
in ipv4s. The standard unix tools like `ping` and `ftp` interpret
leading zeros as octal. Java's built in ip parsing interprets them as
decimal. Because folks are using this for security rules we need to
support all the choices.

Closes #125460
2025-04-11 19:45:14 +02:00
Andrei Dan
fa09255182
Online prewarming service interface docs and usage in SearchService (#126561)
This adds the interface for search online prewarming with a default NOOP
implementation. This also hooks the interface in the SearchService after
we fork the query phase to the search thread pool.
2025-04-11 17:53:50 +01:00
David Turner
800cf72e1f
Use TimeValue for timeouts in safeAwait etc. (#126509)
There's no need to force callers to deconstruct the `TimeValue` in their
possession into a `long` and a `TimeUnit`, we can do it ourselves.
2025-04-12 02:46:28 +10:00
Tanguy Leroux
f57be54001
[CI] Fix IndexShardTests.testReentrantEngineReadLockAcquisitionInRefreshListener (#126685)
I suspect the test resets/closes the reference manager
between the refresh and the retrieval of the segment
generation after the refresh.

By executing segmentGenerationAfterRefresh while
holding the engine reset lock we make sure there
are no concurrent engine resets meanwhile.

In the future, we should also ensure that
IndexShard.refresh() uses withEngine.

Closes #126628
2025-04-11 18:45:18 +02:00
Niels Bauman
507f40cd72
Fix ILMDownsampleDisruptionIT.testILMDownsampleRollingRestart (#126692)
Wait for the index to exist on the master node to ensure all nodes have
the latest cluster state.

Fixes #126495
2025-04-11 17:45:45 +02:00
Jack Conradson
856323594d
Add a custom toString to DynamicMap (#126562)
This change prevents a delegate map from giving an inconsistent 
toString or an empty toString.

Closes #70262
2025-04-11 08:34:48 -07:00
Niels Bauman
ac7eccc1e4
Unmute #126348 (#126690)
This was already fixed by #126501.

Fixes #126348
2025-04-12 01:27:09 +10:00
elasticsearchmachine
e3fd1841f9 Mute org.elasticsearch.repositories.blobstore.testkit.analyze.S3RepositoryAnalysisRestIT testRepositoryAnalysis #126576 2025-04-12 01:22:07 +10:00
Lorenzo Dematté
e4af657c12
Patcher improvements (HDFS) (#126449)
Patchers transform specific classes in some "broken" dependencies to ensure they behave correctly (fixing a bug, disabling some undesired or dangerous behaviour, updating calls to deprecated or removed method overloads).

If we upgrade one of the dependencies we patch, we have a concerns that the patchers may not work against the classes in the new version.
This PR addresses this concern by introducing a check on the SHA256 digest of the class, to ensure we are operating on the same bytes the patcher was designed for; if the digest changes that means the class has been changed (e.g. for a dependency update). If that happens, we break the build process with a specific error, so we can double check that the patchers still work against the new classes.

Extracted from #126326

Relates to ES-11279
2025-04-11 17:20:45 +02:00
David Turner
1461820dac
Fix race condition in RestCancellableNodeClient (#126686)
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 00:59:46 +10:00
Bogdan Pintea
9784e0ec5f
ESQL: Split grouping functions based on their EVAL-ability (#126597)
This splits the grouping functions in two: those that can be evaluated independently through the EVAL operator (`BUCKET`) and those that don't (like those that that are evaluated through an agg operator, `CATEGORIZE`).

Closes #124608
2025-04-11 16:19:54 +02:00
Martijn van Groningen
f658af6628
Allow a tsdb data stream to rolled over to a logsdb data stream (#126640)
and the other way around.

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
2025-04-11 15:59:52 +02:00
Nik Everett
5689dfa9bb
ESQL: Heuristics to pick efficient partitioning (#125739)
Adds heuristics to pick an efficient partitioning strategy based on the
index and rewritten query. This speeds up some queries by throwing more
cores at the problem:
```
FROM test | STATS SUM(b)

Before: took: 31 CPU: 222.3%
 After: took: 15 CPU: 806.9%
```

It also lowers the overhead of simpler queries by throwing less cores at
the problem when it won't really speed anything up:
```
FROM test

Before: took: 1 CPU: 48.5%
 After: took: 1 CPU: 70.4%
```

We have had a `pragma` to control our data partitioning for a long time,
this just looks at the query to pick a partitioning scheme. The
partitioning options:
* `shard`: use one core per shard
* `segment`: use one core per large segment
* `doc`: break each shard into as many segments as there are cores

`doc` is the fastest, but has a lot of overhead, especially for complex
Lucene queries. `segment` is fast, but doesn't make the most out of CPUs
when there are few segments. `shard` has the lowest overhead.

Previously we always used `segment` partitioning because it doesn't have
the terrible overhead but is fast. With this change we use `doc` when
the top level query matches all documents - those have very very low
overhead even in the `doc` partitioning. That's the twice as fast
example above.

This also uses the `shard` partitioning for queries that don't have to
do much work like `FROM foo` or `FROM foo | LIMIT 1` or
`FROM foo | SORT a`. That's the lower CPU example above.

This forking choice is taken very late on the data node. So queries like
this:
```
FROM test | WHERE @timestamp > "2025-01-01T00:00:00Z" | STATS SUM(b)
```
can also use the `doc` partitioning when all documents are after the
timestamp and all documents have `b`.
2025-04-11 09:58:35 -04:00
Ievgen Degtiarenko
b96a2f6c89
Simplify DataNodeRequestSender (#126664) 2025-04-11 15:53:16 +02:00
Colleen McGinnis
24dfda583f
update mapped_pages (#126647) 2025-04-11 08:48:29 -05:00
Ben Chaplin
c11b8f130c
Remove unnecessary request from log tests (#126556) 2025-04-11 09:46:30 -04:00
Fang Xing
e8ffb38d5d
[ES|QL] Retrieve token text only when necessary (#126578)
* retrieve token text only when necessary
2025-04-11 09:40:20 -04:00
kanoshiou
4cc21b6f35
ESQL: Fix NULL handling in IN clause (#125832)
This PR fixes #119950 where an `IN` query includes `NULL` values with non-NULL `DataType` appearing within the query range. An expression is considered `NULL` when its `DataType` is `NULL` or it is a `Literal` with a value of `null`.
2025-04-11 14:58:28 +02:00
Kathleen DeRusso
489a38895e
Update chunking_settings docs for semantic_text (#126634)
* Update chunking_settings docs for semantic_text

* Remove redundancy
2025-04-11 08:55:47 -04:00
Jonathan Buttner
39e594f9b9
[ML] Exposing OpenAI URL field in services API (#126638)
* Adding url configuration field

* Fixing test
2025-04-11 08:26:35 -04:00
Francisco Fernández Castaño
7ad2369f7e
Guard Get operations against Engine resets (#125646)
Closes ES-11324

---------

Co-authored-by: tlrx <tlrx.dev@gmail.com>
2025-04-11 14:19:42 +02:00
Rene Groeschke
31995ace2d
Add docker hub specific docker context (#126625)
The labels we require for openshift are incompatible with docker hub policies. therefore we need to use different docker contexts for those.
2025-04-11 13:30:00 +02:00
Martijn van Groningen
6012590929
Improve resiliency of UpdateTimeSeriesRangeService (#126637)
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 12:58:10 +02:00
Liam Thompson
6da2f34f70
Fix issue links in breaking-changes.md (#126675) 2025-04-11 12:55:13 +02:00
Quentin Pradet
1f68bfbc3e
Add back inference.inference API (#126601) 2025-04-11 14:09:51 +04:00
Armin Braun
55453aeef6
Dry up o.e.c.lucene.Lucene transport logic (#126646)
We've accumulated quited a bit of duplication here, drying this logic up a little.
2025-04-11 11:39:53 +02:00
Liam Thompson
ef633d53bd
Add license mention to ESQL categorize (#126666)
* Add license mention to ESQL categorize
exceptional licensing mention in docs
2025-04-11 11:13:12 +02:00
Tim Vernum
a0dd4e76ec
Reduce use of deprecated Metadata builder method (#124290)
This removes all non-test usage of

     Metadata.Builder.put(IndexMetadata.Builder)

And replaces it with appropriate calls to the equivalent method on
`ProjectMetadata.Builder`

In most cases this _does not_ make the code project aware, but does
reduce the number of deprecated methods in use
2025-04-11 18:36:19 +10:00
Armin Braun
788cd26a0f
Fix missing BwC in QuerySearchResult (#126636)
Forgot to update for 8.19.x changes after backporting.

closes #126633
closes #126632
2025-04-11 10:33:17 +02:00