Commit graph

83401 commits

Author SHA1 Message Date
elasticsearchmachine
970973a7bc Bump versions after 8.16.4 release 2025-02-11 20:18:32 +00:00
elasticsearchmachine
08d0d405a3 Prune changelogs after 8.17.2 release 2025-02-11 19:52:59 +00:00
elasticsearchmachine
91666d14f2 Bump versions after 8.17.2 release 2025-02-11 19:50:48 +00:00
Luke Whiting
f06e9361ae
Ensure removal of index blocks does not leave key with null value (#122246) (#122264)
* ES-10801 Ensure removal of index blocks does not leave key with null value

* Update docs/changelog/122246.yaml
2025-02-12 03:16:34 +11:00
Parker Timmins
3c250e8f56
Remove call to super.cleanupCluster in cleanup methods which does not override parent method (#122209) (#122260)
ReindexDataStreamIndexAction.cleanupCluster called EsIntegTestCase.cleanupCluster, but did not override it. This caused EsIntegTestCase.cleanupCluster to be called twice, once in ReindexDataStreamIndexAction.cleanupCluster and once when the After annotation is called on EsIntegTestCase.

(cherry picked from commit 89ba03ecff)

# Conflicts:
#	muted-tests.yml
2025-02-12 02:58:41 +11:00
Iván Cea Fontenla
1782b57857
ESQL: Remove AggregateMapper reflection, and delegate intermediate state to suppliers (#122023) (#122183)
To avoid having AggregateMapper find aggregators based on their names with reflection, I'm doing some changes:
- Make the suppliers have methods returning the intermediate states
- To allow this, the suppliers constructor won't receive the chanells as params. Instead, its methods will ask for them
  - Most changes in this PR are because of this
- After those changes, I'm leaving AggregateMapper still there, as it still converts AggregateFunctions to its NamedExpressions

(cherry picked from commit 7bea3a5610)

# Conflicts:
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/AggregateMapper.java
2025-02-11 11:53:00 +01:00
Lorenzo Dematté
546d1844eb
Add test to ensure backports from 9.1 are done correctly (#122016) 2025-02-11 10:30:34 +01:00
Luigi Dell'Aquila
f49e3c45e1
EQL: fix JOIN command validation (not supported) (#122011) (#122169) 2025-02-11 19:27:56 +11:00
John Verwolf
7dce3566b7
Fix privileges for system index migration WRITE block (#122214)
* Fix privileges for system index migration WRITE block  (#121327)

This PR removes a potential cause of data loss when migrating system indices. It does this by changing the way we set a "write-block" on the system index to migrate - now using a dedicated transport request rather than a settings update. Furthermore, we no longer delete the write-block prior to deleting the index, as this was another source of potential data loss. Additionally, we now remove the block if the migration fails.

* Update release notes

* Delete docs/changelog/122214.yaml
2025-02-11 09:51:40 +11:00
Dan Rubinstein
20b720b047
Fix get all inference endponts not returning multiple endpoints sharing model deployment (#121821) (#122206)
* Fix get all inference endponts not returning multiple endpoints sharing model deployment

* Update docs/changelog/121821.yaml

* Clean up modelsByDeploymentId generation code

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-11 07:17:07 +11:00
Luca Cavanna
f078c384cc
Fix SearchTimeoutIT (#120390) (#122191)
Two of the timeout tests have been muted for several months. The reason is that we tightened the assertions to cover for partial results being returned, but there were edge cases in which partial results were not actually returned.

The timeout used in the test was time dependent, hence when the timeout precisely will be thrown is unpredictable, because we have timeout checks in different places in the codebase, when iterating through the leaves, before scoring any document, or while scoring documents. The edge case that caused failures is a typical timing issue where the initial check for timeout in CancellableBulkScorer already triggers the timeout, before any document has been collected.

I made several adjustments to the test to make it more robust:
- use index random to index documents, that speeds it up
- share indexing across test methods, so that it happens once at the suite level
- replace the custom query that triggers a timeout to not be a script query, but rather a lucene query that is not time dependent, and throws a time exceeded exception precisely where we expect it, so that we can test how the system reacts to that. That allows to test that partial results are always returned when a timeout happens while scoring documents, and that partial results are never returned when a timeout happens before we even started to score documents. 

Closes #98369
Closes #98053
2025-02-11 06:43:46 +11:00
Martijn van Groningen
5634676786
Conditionally use sequential stored field reader in LuceneSyntheticSourceChangesSnapshot (#121636) (#122202)
Improve LuceneSyntheticSourceChangesSnapshot by triggering to use a sequential stored field reader if docids are dense. This is done by computing for which docids to synthesize recovery source for. If the requested docids are dense and monotonic increasing a sequential stored field reader is used, which provided recovery source for many documents without repeatedly de-compressing the same block of stored fields.
2025-02-11 06:38:06 +11:00
Luigi Dell'Aquila
d5d7937415
ES|QL: Remove redundant sorts from execution plan (#121156) (#122187) 2025-02-11 05:25:45 +11:00
Samiul Monir
e54acc36f9
Fix - Requesting _inference_fields when using legacy format causes shard failure (#121720) (#122177)
* Adding condition to verify if the field belongs to an index

* Update docs/changelog/121720.yaml

* Remove unnecessary comma from yaml file

* remove duplicate inference endpoint creation

* updating isMetadata to return true if mapper has the correct type

* remove unnecessary index creation in yaml tests

* Adding check if the document has returned in the yaml test

* Updating test to skip time series  check if index mode is standard

* Refactor tests to consider verifying every metafields with all index modes

* refactoring test to verify for all cases

* Adding assetFalse if not time_series and fields are from time_series

* updating test texts to have better description
2025-02-11 01:52:25 +11:00
Andrei Dan
8854117de4
[TEST] wait for all active shards when indexing data (#122163)
This attempts to fix a flay test where the term_freq returned
by the multiple terms vectors API was `null`.
I was not able to reproduce this test but this proposes a fix
based on the following running theory:
- an Elasticsearch cluster comprised of at least 2 nodes
- we create a couple of indices with 1 primary and 1 replica
- we index a document that was acknowledged only by the primary
(because `wait_for_active_shards` defaults to `1`)
- the test executes the multiple terms vectors API and it hits the
node hosting the replica shard, which hasn't yet received the
document we ingested in the primary shard.

This race condition between the document replication and the test
running the terms vectors API on the replica shard could yield
a `null` value for the the term's `term_freq` (as the replica shard
contains 0 documents).

This PR proposes we change the `wait_for_active_shards` value to
`all` so each write is acknowledged by all replicas before the client
receives the response.

(cherry picked from commit a148fa2828)
Signed-off-by: Andrei Dan <andrei.dan@elastic.co>
2025-02-10 22:52:06 +11:00
David Kyle
86542f073f
[ML] Fix infer on and elasticsearch service endpoint created with a deployment id (#121428) (#121438)
Fixes a bug where the deployment Id was lost creating the text embedding
model configuration
2025-02-10 21:26:36 +11:00
Tim Vernum
cfcd1c61ef
Remove TLSv1.1 from default protocols (#121731) (#122159)
This commit removes "TLSv1.1" from the list of default protocols in
Elasticsearch (starting with ES9.0)

TLSv1.1 has been deprecated by the IETF since March 2021

This affects a variety of TLS contexts, include
 - The HTTP Server (Rest API)
 - Transport protocol (including CCS and CCR)
 - Outgoing connections for features that have configurable SSL
   settings. This includes
    - reindex
    - watcher
    - security realms (SAML, OIDC, LDAP, etc)
    - monitoring exporters
    - inference services

In practice, however, TLSv1.1 has been disabled in most Elasticsearch
deployments since around 7.12 because most JDK releases have disabled
TLSv1.1 (by default) starting in April 2021

That is, if you run a default installation of Elasticsearch (for any
currently supported version of ES) that uses the bundled JVM then
TLSv1.1 is already disabled.
And, since ES9+ requires JDK21+, all supported JDKs ship with TLSv1.1
disabled by default.

In addition, incoming HTTP connections to Elastic Cloud deployments
have required TLSv1.2 or higher since April 2020

This change simply makes it clear that Elasticsearch does not
attempt to enable TLSv1.1 and administrators who wish to use that
protocol will need to explicitly enable it in both the JVM and in
Elasticsearch.

Resolves: #108057
2025-02-10 20:21:36 +11:00
Niels Bauman
9be965d41d
Increase timeout in DataStreamLifecycleDownsampleDisruptionIT (#122151) (#122156)
The downsample task sometimes needs a little bit longer to complete so
we bump the timeout from 60s to 120s.

Fixes #122056

(cherry picked from commit 0ec2fe05ef)

# Conflicts:
#	muted-tests.yml
2025-02-10 19:20:21 +11:00
elasticsearchmachine
cd1acdb78d Mute org.elasticsearch.xpack.migrate.action.ReindexDatastreamIndexTransportActionIT testTimestamp0AddedIfMissing #121745 2025-02-09 01:07:43 +11:00
elasticsearchmachine
674a898789 Mute org.elasticsearch.xpack.migrate.action.ReindexDatastreamIndexTransportActionIT testFailIfReadBlockSet #122123 2025-02-09 01:07:37 +11:00
Nhat Nguyen
e65e8659a6
Handle rejection in DriverScheduler (#122105) (#122118)
When a node is shutting down, scheduling tasks for the Driver can result 
in a rejection exception. In this case, we drain and close all
operators. However, we don't clear the pending tasks in the scheduler,
which can lead to a pending task being triggered unexpectedly, causing a
ConcurrentModificationException.
2025-02-08 17:25:09 +11:00
Stanislav Malyshev
5df9d4cc4e
Fix async stop sometimes not properly collecting result (#121843) (#122114)
* Fix async stop sometimes not properly collecting result

(cherry picked from commit d11dad44cc)
2025-02-08 16:20:07 +11:00
Nhat Nguyen
9b2d829278 Unmute #118238 (#122112)
Closes #118238
Fixed in #118370
2025-02-07 20:43:54 -08:00
Mary Gouseti
a699e976b0
[9.0] [Deprecation API] Adjust details in the SourceFieldMapper deprecation warning (#122041) (#122068)
* [Deprecation API] Adjust details in the SourceFieldMapper deprecation warning (#122041)

In this PR we improve the deprecation warning about configuring source
in the mapping.

- We reduce the size of the warning message so it looks better in kibana.
- We keep the original message in the details.
- We use an alias help url, so we can associate it with the guide when it's created.

* Remove bwc code
2025-02-08 10:25:09 +11:00
Ryan Ernst
1b9249938d
Use dynamic policy for entitled test plugin (#121852) (#122096)
Like the plugin being testing, the entitled test plugin needs access to
dynamic elements (namely, file paths). This commit dynamically generates
the entitlement policy for the entitlted test plugin when it is
installed. It also adds using the file entitltlement as an example.
2025-02-08 08:54:43 +11:00
Ryan Ernst
03774c7ac7
Remove assertion about theoretical path separators (#122069) (#122090)
The only real path separators are either forward or back slash. Trying
to use something else like newline fails to even parse as a path on
windows. This commit removes testing of other separators.

closes #121872
2025-02-08 07:59:04 +11:00
Nik Everett
e1f8b51648
Aggs: Comment on deprecated execution mode (#122046) (#122077)
This adds a comment to `execution_mode: global_ordinals_hash` explaining
that we're not going to remove it so we don't break anyone.
2025-02-08 06:56:39 +11:00
Nik Everett
32bcd49748
Retry timeout tests for aggs (#122031) (#122076)
The aggs timeout test waits for the agg to return and then double checks
that the agg is stopped using the tasks API. We're seeing some failures
where the tasks API reports that the agg is still running. I can't
reproduce them because computers. This adds two things:
1. Logs the hot_threads so we can see if the query is indeed still
   running.
2. Retries the _tasks API for a minute. If it goes away soon after the
   _search returns that's *fine*. If it sticks around for more than a
   few seconds then the cancel isn't working. We wait for a minute
   because CI can't be trusted to do anything quickly.

Closes #121993
2025-02-08 06:46:43 +11:00
David Turner
4fa137d6b2
Fork post-snapshot-delete cleanup off master thread (#122047) (#122073)
We shouldn't run the post-snapshot-delete cleanup work on the master
thread, since it can be quite expensive and need not block subsequent
cluster state updates. This commit forks it onto a `SNAPSHOT` thread.
2025-02-08 06:14:31 +11:00
Brian Seeders
ac472a9925
[CI] Add VERSION_QUALIFIER to hadoop build trigger 2025-02-07 13:57:55 -05:00
Simon Cooper
8c57f8099b
Add a parameter to describe the lambda in a transformedMatch matcher (#122013) (#122064) 2025-02-08 05:31:54 +11:00
Keith Massey
820934cfdc
Removing the type from the destination index when using CreateIndexFromSourceAction (#121982) (#122058)
It is possible to create an index in 7.x with a single type. This fixes the CreateIndexFromSourceAction to not copy that type over when creating a destination index from a source index with a type.
2025-02-08 04:39:51 +11:00
Nhat Nguyen
f1f2af71ce
Avoid cyclic exception in ExchangeSource (#121995) (#122055)
Since introducing the fail_fast (see #117410) option to remote sinks, 
the ExchangeSource can propagate failures that can lead to circular
references. The issue occurs as follows:

1. remote-sink-1 fails with exception e1, and the failure collector collects e1.

2. remote-sink-2 fails with exception e2, and the failure collector collects e2.

3. The listener of remote-sink-2 propagates e2 before the listener of 
remote-sink-1 propagates e1.

4. The failure collector in ExchangeSource sees [e1, e2] and suppresses 
e2 to e1. The upstream sees [e2, e1] and suppresses e1 to e2, leading to
a circular reference.

With this change, we stop collecting failures in ExchangeSource.

Labelled this non-issue for an unreleased bug.

Relates #117410
2025-02-08 04:35:52 +11:00
Lorenzo Dematté
b29a5ae6fc
Missing providers from nio (#122004) (#122053) 2025-02-08 04:18:08 +11:00
Lorenzo Dematté
09a64e625e
[Entitlements] Add native checks support and tests for Java 21 (preview) (#121881) (#122050) 2025-02-08 04:13:37 +11:00
Jonathan Buttner
3c15867569
[ML] Inference API removing _unified and using _stream instead (#121804) (#122042)
* Adding proxy action

* [CI] Auto commit changes from spotless

* Incrementing reference count for body content and fixing tests

* [CI] Auto commit changes from spotless

* Refactoring

* Update x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/action/InferenceActionProxy.java

Co-authored-by: David Kyle <david.kyle@elastic.co>

* Addressing feedback

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Co-authored-by: David Kyle <david.kyle@elastic.co>
(cherry picked from commit ab482350e6)

# Conflicts:
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/rest/BaseInferenceActionTests.java
2025-02-08 03:25:56 +11:00
David Kyle
f61c93733e
[ML] Give the kibana user read/write access to reindexed hidden ml indices (#121897) (#122037)
Indices are reindexed on upgrade. Adds an index pattern to the role
descriptor matching the upgraded indices
2025-02-08 03:19:54 +11:00
Nik Everett
f5d0a85b0d
ESQL: Update kibana signatures (#121951) (#122032)
This updates the kibana signature json files in two ways:
* Renames `eval` to `scalar` - that's the name we use inside of ESQL and
  we may as well make the name the same.
* Calls the `CATEGORIZE` and `BUCKET` function `grouping` because they
  can only be used in the "grouping" positions of the `STATS` command.

Closes #113411
2025-02-08 03:00:54 +11:00
Nik Everett
fe8e71d8e1
ESQL: Clean index when retrying test (#121954) (#121979)
This modifies the `HeapAttackIT` test to clean an index created by the
test if we have to retry it.

Closes #121873
2025-02-08 01:50:12 +11:00
Luigi Dell'Aquila
a3a38b5d99
ES|QL: fix ENRICH validation for use of wildcards (#121911) (#122017) 2025-02-08 00:22:07 +11:00
Ievgen Degtiarenko
d41e1d3d0a
Fix testValidFromPattern (#121996) (#122009)
(cherry picked from commit c92b7b568e)
2025-02-07 22:39:45 +11:00
Luigi Dell'Aquila
c2da1e19c1
ES|QL: Improve random query generation tests (#121750) (#122001) 2025-02-07 21:26:56 +11:00
elasticsearchmachine
8e8156c141 Mute org.elasticsearch.xpack.esql.parser.StatementParserTests testValidFromPattern #121990 2025-02-07 17:06:42 +11:00
Ryan Ernst
f5d3f3810f
Add 9.0 patch transport version constants #121985 (#121986)
* Add 9.0 patch transport version constants #121985

Transport version changes must be unique per branch. Some transport
version changes meant for 9.0 are missing unique backport constants.
This is a backport of #121985, adding unique transport version patch
numbers for each change intended for 9.0.

* match constant naming in main
2025-02-07 12:10:23 +11:00
Joe Gallo
eb32a9beb2
Fix geoip databases index access after system feature migration (#121196) (#121946)
Co-authored-by: Keith Massey <keith.massey@elastic.co>
2025-02-07 11:20:16 +11:00
Pat Whelan
b7367490a9
[ML] Parse mid-stream errors from OpenAI and EIS (#121806) (#121961)
When we are already parsing events, we can receive errors as the next
event.

OpenAI formats these as:
```
event: error
data: <payload>
```

Elastic formats these as:
```
data: <payload>
```

Unified will consolidate them into the new error structure.
2025-02-07 11:14:10 +11:00
elasticsearchmachine
50d9778e9a Mute org.elasticsearch.xpack.migrate.action.ReindexDatastreamIndexTransportActionIT testFailIfMetadataBlockSet #121978 2025-02-07 09:48:33 +11:00
elasticsearchmachine
5ca1c8d069 Mute org.elasticsearch.xpack.migrate.action.ReindexDatastreamIndexTransportActionIT testDestIndexNameSet_withDotPrefix #121977 2025-02-07 09:48:23 +11:00
elasticsearchmachine
c11171a217 Mute org.elasticsearch.xpack.migrate.action.ReindexDatastreamIndexTransportActionIT testTimestampNotAddedIfExists #121842 2025-02-07 09:48:13 +11:00
Pat Whelan
8611b74c03
[Transform] Recreate Notifications Index (#121912) (#121943)
If the notification index and alias gets deleted, recreate the index.

Fix #121909
2025-02-07 08:09:17 +11:00