Commit graph

2485 commits

Author SHA1 Message Date
Ryan Ernst
b5e92db171
Remove security manager from tests (#127087)
Now that entitlements are always used, there is no need to run tests
with security manager (a future enhancement will run tests with
entitlements). This commit removes setting up security manager from
tests.
2025-04-22 18:08:09 +02:00
James Baiera
7b89f4d4a6
Add ability to redirect ingestion failures on data streams to a failure store (#126973)
Removes the feature flags and guards that prevent the new failure store functionality 
from operating in production runtimes.
2025-04-18 16:33:03 -04:00
Lorenzo Dematté
69f6520b0c
[Entitlements] Validation checks on paths (#126852)
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-18 15:36:07 +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
Jordan Powers
4c174a891f
Use Lucene101 postings format by default (#126080)
Update the PerFieldFormatSupplier so that new standard indices use the
Lucene101PostingsFormat instead of the current default ES812PostingsFormat.

Currently, use of the new codec is gated behind a feature flag.
2025-04-04 12:41:27 -07:00
Alexey Ivanov
fd7efe587e
[main] Move system indices migration to migrate plugin (#125437)
* [main] Move system indices migration to migrate plugin

It seems the best way to fix #122949 is to use existing data stream reindex API. However, this API is located in the migrate x-pack plugin. This commit moves the system indices migration logic (REST handlers, transport actions, and task) to the migrate plugin.

Port of #123551

* [CI] Auto commit changes from spotless

* Fix compilation

* Fix tests

* Fix test

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-04-04 18:49:38 +01:00
Ben Chaplin
9f6eb1d4e3
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.
2025-04-03 13:45:09 -04:00
Niels Bauman
483f97915c
Run TransportGetIndexAction on local node (#125652)
This action solely needs the cluster state, it can run on any node.
Since this is the last class/action that extends the `ClusterInfo`
abstract classes, we remove those classes too as they're not required
anymore.

Relates #101805
2025-04-02 18:41:35 +01:00
Niels Bauman
eb4d64f94a
Run TransportGetSettingsAction on local node (#126051)
This action solely needs the cluster state, it can run on any node.
Additionally, it needs to be cancellable to avoid doing unnecessary work
after a client failure or timeout.

Relates #101805
2025-04-02 15:05:31 +01:00
Lorenzo Dematté
40dd91b800
[Entitlements] Replace Permissions with Entitlements in InstallPluginAction (#125207)
This PR replaces the parsing and formatting of SecurityManager policies with the parsing and formatting of Entitlements policy during plugin installation.

Relates to ES-10923
2025-04-02 11:03:27 +01:00
Armin Braun
fd2cc97541
Introduce batched query execution and data-node side reduce (#121885)
This change moves the query phase a single roundtrip per node just like can_match or field_caps work already. 
A a result of executing multiple shard queries from a single request we can also partially reduce each node's query results on the data node side before responding to the coordinating node.

As a result this change significantly reduces the impact of network latencies on the end-to-end query performance, reduces the amount of work done (memory and cpu) on the coordinating node and the network traffic by factors of up to the number of shards per data node!

Benchmarking shows up to orders of magnitude improvements in heap and network traffic dimensions in querying across a larger number of shards.
2025-03-29 16:53:18 +01:00
Carlos Delgado
968bddc462
Non existing synonyms sets do not fail shard recovery (#125659) 2025-03-27 18:04:20 +02:00
Yang Wang
0c8daaeca5
Make SnapshotsInProgress project compatible (#125470)
This PR adds project-id to both SnapshotsInProgress and Snapshot so that
they are aware of projects and ready to handle snapshots from multiple
projects.

Relates: ES-10224
2025-03-27 10:54:53 +11:00
Mark Vieira
0388a5980c
Migrate legacy QA projects to new test clusters framework (#125545) 2025-03-26 10:05:56 -07:00
Keith Massey
13110d778b
Using a consistent index template name to avoid undefined behavior (#125624) 2025-03-26 01:00:27 +02:00
Mark Vieira
65751062f7
Re-enable VerifyVersionConstantsIT (#125605) 2025-03-25 12:16:53 -07:00
Armin Braun
50437e79d3
Cleanup missing use of StandardCharsets (#125424)
Random annoyance that I figured, I'd just fix globally:
We can do a bit of a cleaner job when doing byte <-> string conversion here and there.
2025-03-21 20:10:15 +01:00
Tanguy Leroux
8a56518034
[CI] Reenable N-2 BWC tests for non-snapshot builds (#125296)
We can reenable those tests for `release-test`, now the
code exist in 8.18, 8.x and 9.0 branches.

Closes #119550
2025-03-21 10:18:10 +01:00
Rene Groeschke
38f243944e
Fix failing docker packaging tests due to too long commandline (#125053)
* Increate COLUMN for detecting running elasticsearch instance
* Unmute DockerTest test
2025-03-20 08:27:40 +01:00
Martijn van Groningen
ae16016290
Update disable assertion jvm args from bwc/mixed cluster setups. (#125074)
Remove `-da:org.elasticsearch.index.mapper.DocumentMapper` and `-da:org.elasticsearch.index.mapper.MapperService` from mixed cluster/bwc cluster setups. Given that #122606 is now backported to the 8.18 branch.
2025-03-19 08:10:50 +01:00
Rene Groeschke
ae569def9c
[Build] Require reason for usesDefaultDistribution (#124707)
This makes using usesDefaultDistribution in our test setup for explicit by requiring a reason why it's needed.
This is helpful as part of revisiting the need for all those usages in our code base.
2025-03-17 08:25:39 +01:00
Niels Bauman
481d91c428
Run TransportGetMappingsAction on local node (#122921)
This action solely needs the cluster state, it can run on any node.
Additionally, it needs to be cancellable to avoid doing unnecessary work
after a client failure or timeout.

Relates #101805
2025-03-15 07:59:28 +00:00
Michael Peterson
eee890a783
Fix resource leak in CrossClusterSearchUnavailableClusterIT (#124880)
Fixes https://github.com/elastic/elasticsearch/issues/123814
2025-03-14 13:53:32 -04:00
Nik Everett
a80402b13b
TSDB: Remove test compatibility for untested (#124113)
Removes testing compatibility switches for versions we no longer test
against.
2025-03-10 10:53:51 -04:00
Armin Braun
425823cb5c
Remove some overhead from TransportService message handling (#124428)
Avoiding some indirection, volatile-reads and moving the listener
functionality that needlessly kept iterating an empty CoW list (creating
iterator instances, volatile reads, more code) in an effort to improve
the low IPC on transport threads.
2025-03-09 16:00:11 +01:00
Martijn van Groningen
ea8283e9c8
Avoid serializing empty _source fields in mappings. (#122606) 2025-03-06 12:20:07 +01:00
Martijn van Groningen
26de5343a2
Remove synthetic recovery source feature flag. (#122615)
This feature flag controls whether synthetic recovery source is enabled by default when the source mode is synthetic.

The synthetic recovery source feature itself is already available via the index.recovery.use_synthetic_source index setting and can be enabled by anyone using synthetic source.

The default value of index.recovery.use_synthetic_source setting defaults to true when index.mapping.source.mode is enabled. The index.mapping.source.mode default to true if index.mode is logsdb or time_series.

In other words, with this change synthetic recovery source will be enabled by default for logsdb and tsdb.

Closes #116726
2025-03-05 15:43:33 +01:00
Rene Groeschke
496c38e5a5
Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896)
This reverts commit 36660f2e5f.
2025-03-05 08:02:13 +01:00
Mark Vieira
d61b86477d
Add jdk.management.agent module to server boot layer on start (#123938) 2025-03-04 11:32:42 -08:00
Christoph Büscher
0f14c4f065
Add test for deprecated index settings in N-2 indices (#122493)
This change adds a new rolling upgrade test that checks having certain deprecated
index settings present in an N-2 index doesn't prevent the index from being opened
in the current version. The deprecated settings specifically tested here are:

* index.mapper.dynamic
* index.max_adjacency_matrix_filters
* index.force_memory_term_dictionary
* index.soft_deletes.enabled
2025-03-04 11:13:32 +01:00
Rene Groeschke
36660f2e5f
Revert "Update Gradle wrapper to 8.13 (#122421)" (#123889)
This reverts commit e19b2264af.
2025-03-03 15:51:07 +01:00
Rene Groeschke
e19b2264af
Update Gradle wrapper to 8.13 (#122421)
* Fix Gradle Deprecation warning as declaring an is- property with a Boolean type has been deprecated.
* Make use of new layout.settingsFolder api to address some cross project references
* Fix buildParams snapshot check for multiprojet projects
2025-03-03 14:10:00 +01:00
Mark Vieira
9a37fbfbee
Remove NodesCapabilitiesUpgradeIT (#123561) 2025-02-27 16:31:38 -08:00
Mark Vieira
b8b77eaa81
Remove XPackIT (#123558) 2025-02-27 16:31:27 -08:00
Mark Vieira
d2da07716e
Remove rolling upgrade test that is no longer applicable (#123557) 2025-02-27 16:31:15 -08:00
Mark Vieira
d9c0ef156a
Fix enrollment packaging test when running on Java 24 (#123650) 2025-02-27 14:40:27 -08:00
Mark Vieira
feb3a60e98
Add forwards compatibility testing (#123436) 2025-02-26 08:56:30 -08:00
Simon Cooper
274be7997a
Create a SearchResponseBuilder for creating SearchResponses in tests (#122196)
As well as simplifying test code, this also highlights which settings in the response are actually needed for individual tests
2025-02-21 12:00:17 +00:00
Kostas Krikellas
a79b15d414
[TEST] Cover basic license in logsdb rolling upgrade tests (#123095)
* Use min node version to guard injecting settings in logs provider

* Update docs/changelog/123005.yaml

* no random in cluster init

* Cover basic license in logsdb rolling upgrade tests
2025-02-21 11:17:06 +02:00
Benjamin Trent
894db68357
Potentially addressing bbq bwc failures and added logging (#122553)
I have ran this many times locally, and it never failed. Maybe there is
something "magical" in CI. 

Added some additional info in the assertion logging.
2025-02-19 03:46:04 +11:00
Moritz Mack
d78bfe8f6e
Skip SM policy tests for JDK 24 when Security Manager is not available anymore (#122828) 2025-02-18 14:09:59 +01:00
Salvatore Campagna
780cac5a6d
Enable a sparse doc values index for @timestamp in LogsDB (#122161)
This PR extends the work done in #121751 by enabling a sparse doc values index for the @timestamp field in LogsDB.

Similar to the previous PR, the setting index.mapping.use_doc_values_skipper will override the index mapping parameter when all of the following conditions are met:

* The index mode is LogsDB.
* The field name is @timestamp.
* Index sorting is configured on @timestamp (regardless of whether it is a primary sort field or not).
* Doc values are enabled.

This ensures that only one index structure is defined on the @timestamp field:
* If the conditions above are met, the inverted index is replaced with a sparse doc values index.
* This prevents both the inverted index and sparse doc values index from being enabled together, reducing unnecessary storage overhead.

This change aligns with our goal of optimizing LogsDB for storage efficiency while possibly maintaining reasonable query latency performance. It will enable us to run benchmarks and evaluate the impact of sparse indexing on the @timestamp field as well.
2025-02-17 13:31:26 +01:00
Joe Gallo
5c00341c2b
Handle 404s from the _cat/indices api in FullClusterRestartIT (#122537) 2025-02-13 21:14:04 -05:00
Joe Gallo
e082ad56bf
Update Maxmind mmdb fixture files (#122225) 2025-02-11 10:47:54 -05:00
Armin Braun
d3abf9d5ba
Dry up search error trace ITs (#122138)
This logic will need a bit of adjustment for bulk query execution.
Lets dry it up before so we don't have to copy and paste the fix which
will be a couple lines.
2025-02-10 08:48:49 +01:00
Martijn van Groningen
d93f9c4d58
Address synthetic recovery source release test failures. (#122035) 2025-02-07 13:02:27 -08:00
Mary Gouseti
1fe1055aef
[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.
2025-02-08 04:55:14 +11:00
Salvatore Campagna
d507f8f2e0
Re-enable synthetic recovery tests (#121896) 2025-02-06 14:22:56 +01:00
Ryan Ernst
0cf42f2388
Rename environment dir accessors (#121803)
The node environment has many paths. The accessors for these currently
use a "file" suffix, but they are always directories. This commit
renames the accessors to make it clear these paths are directories.
2025-02-05 14:03:28 -08:00
Artem Prigoda
885a5510e1
Don't return or accept node_version in the Desired Nodes API (#119049)
Re-submission of #114580

>  node_version was deprecated in #104209 (8.13) and shouldn't be set or returned in 9.0

Resolve ES-9443
2025-02-05 15:41:47 +01:00