Commit graph

637 commits

Author SHA1 Message Date
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
Mary Gouseti
a525b3d924
Fix test to anticipate force merge failure (#126282)
This test had a copy paste mistake. When the cluster has only one data
node the replicas cannot be assigned so we end up with a force merge
error. In the case of the failure store this was not asserted correctly.

On the other hand, this test only checked for the existence of an error
and it was not ensuring that the current error is not the rollover error
that should have recovered. We make this test a bit more explicit.

Fixes: https://github.com/elastic/elasticsearch/issues/126252
2025-04-05 05:26:58 +11:00
Sam Xiao
b6c6db9861
Add multi-project support for health indicator data_stream_lifecycle (#126056) 2025-04-03 16:26:22 -04:00
Mary Gouseti
488951edf3
Data stream lifecycle does not record error in failure store rollover (#126229)
**Issue** The data stream lifecycle does not register correctly rollover
errors for failure store.

**Observed bahaviour** When data stream lifecycle encounters a rollover
error it records it unless it sees that the current write index of this
data stream doesn't match the source index of the request. However, the
write index check does not use the failure write index but the write
backing index, so the failure gets ignored

**Desired behaviour** When data stream lifecycle encounters a rollover
error it will check the relevant write index before it determines if it
should be recorded or not.
2025-04-04 03:44:09 +11:00
Mary Gouseti
95257bbf07
Make data stream options multi-project aware (#126141) 2025-04-03 14:33:40 +03:00
Mary Gouseti
25050495b9
Data stream options convert to javaRestTests to yamlRestTests. (#126037)
In this PR we introduce the data stream API in the `es-rest-api` using
the feature flag feature. This enabled us to use the `yamlRestTests`
tests instead of the `javaRestTests`.
2025-04-03 01:32:54 +11:00
Niels Bauman
a8f5db2604
Make data stream lifecycle project-aware (#125476)
Now that all actions that DLM depends on are project-aware, we can make DLM itself project-aware.
There still exists only one instance of `DataStreamLifecycleService`, it just loops over all the projects - which matches the approach we've taken for similar scenarios thus far.
2025-03-31 14:52:43 +01:00
Pete Gillin
66432fb886
ES-10037 Track the peak indexing load for each shard (#125521)
This tracks the highest value seen for the recent write load metric
any time the stats for a shard was computed, exposes this value
alongside the recent value, and persists it in index metadata
alongside it too.

The new test in `IndexShardTests` is designed to more thoroughly test
the recent write load metric previously added, as well as to test the
peak metric being added here.

ES-10037 #comment Added peak load metric in https://github.com/elastic/elasticsearch/pull/125521
2025-03-27 12:03:39 +02:00
Mary Gouseti
6503c1b94b
[Failure Store] Conceptually introduce the failure store lifecycle (#125258)
* Specify index component when retrieving lifecycle

* Add getters for the failure lifecycle

* Conceptually introduce the failure store lifecycle (even for now it's the same)
2025-03-26 13:21:48 +02:00
Niels Bauman
8b691db436
Fix data stream retrieval in ExplainDataStreamLifecycleIT (#125611)
These tests had the potential to fail when two consecutive GET data
streams requests would hit two different nodes, where one node already
had the cluster state that contained the new backing index and the other
node didn't yet.

Caused by #122852

Fixes #124882
Fixes #124885
2025-03-26 10:33:33 +00:00
Niels Bauman
542a3b65a9
Fix data stream retrieval in DataStreamLifecycleServiceIT (#125195)
These tests had the potential to fail when two consecutive GET data
streams requests would hit two different nodes, where one node already
had the cluster state that contained the new backing index and the other
node didn't yet.

Caused by #122852

Fixes #124846
Fixes #124950
Fixes #124999
2025-03-24 17:43:09 +02:00
Niels Bauman
f7d7ce7ccc
Run TransportGetDataStreamOptionsAction on local node (#125213)
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-22 16:18:28 +02:00
Niels Bauman
bbc47d9cad
Run TransportGetDataStreamLifecycleAction on local node (#125214)
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-22 13:00:47 +02:00
Mary Gouseti
2c377f9c85
Unify template builders for data stream options, failure store and data stream lifecycle (#125293) 2025-03-21 10:03:27 +02:00
Yang Wang
7a0a399055
[Test] Reconcile TestProjectResolvers (#124988)
This PR updates the different methods in TestProjectResolvers so that
their names are more accurate and behaviours to be more as expected.

For example, In MP-1749, we differentiate between single-project and
single-project only resolvers. The later should not support multi-project.
2025-03-21 11:43:05 +11:00
Niels Bauman
8e64f50d66
Make DLM stats and DLM error store project-aware (#124810)
This is part of the work to make DLM project-aware.

These two features were pretty tightly coupled, so I saved some effort
by combining them in one PR.
2025-03-19 12:39:28 +02:00
Pete Gillin
50e689493c
Calculate recent write load in indexing stats (#124652)
This uses the recently-added `ExponentiallyWeightedMovingRate` class
to calculate a write load which favours more recent load and include
this alongside the existing unweighted all-time write load in
`IndexingStats.Stats`.

As of this change, the new load metric is not used anywhere, although
it can be retrieved with the index stats or node stats APIs.
2025-03-18 21:23:20 +02:00
Mary Gouseti
ce04da7dea
Refactor data stream lifecycle to use the template paradigm (#124593) 2025-03-18 13:24:06 +02: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
Armin Braun
4c1c51e870
Remove remoteAddress field from TransportResponse (#120016)
This field is only used (by security) for requests, having it in responses is redundant.
Also, we have a couple of responses that are singletons/quasi-enums where setting the value
needlessly might introduce some strange contention even though it's a plain store.

This isn't just a cosmetic change. It makes it clear at compile time that each response instance
is exclusively defined by the bytes that it is read from. This makes it easier to reason about the
validity of suggested optimizations like https://github.com/elastic/elasticsearch/pull/120010
2025-03-16 19:54:29 +01:00
John Verwolf
cb3c35783b
Bug Fix: System Data Streams Should Be Restorable (#124651)
This PR adds a new MetadataDeleteDataStreamService that allows us to delete system data streams prior to a restore operation.  This fixes a bug where system data streams were previously un-restorable.
2025-03-14 08:00:44 -07:00
Niels Bauman
f0eb8da172
Make DeleteSourceAndAddDownsampleToDS project-aware (#124808)
This is part of the work to make DLM project-aware.
2025-03-14 08:40:37 +00:00
Niels Bauman
af6eb8cc38
Run TransportGetDataStreamsAction on local node (#122852)
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-13 21:16:14 +00:00
Niels Bauman
20e186a252
Make enrich project-aware (#124099)
Makes the execution and use of enrich policies project-aware.
Note: this does not make the enrich cache project-aware. That is to be
handled in a follow-up PR.
2025-03-06 19:20:46 +01:00
Francisco Fernández Castaño
387eef070c
Enhance memory accounting for document expansion and introduce max document size limit (#123543)
This commit improves memory accounting by incorporating document
expansion during shard bulk execution. Additionally, it introduces a new
limit on the maximum document size, which defaults to 5% of the
available heap.

This limit can be configured using the new setting:

indexing_pressure.memory.max_operation_size
These changes help prevent excessive memory consumption and
improve indexing stability.

Closes ES-10777
2025-03-06 11:26:49 +01:00
Lee Hinman
47706b505f
Add index mode to get data stream API (#122486)
This commit adds the `index_mode` for both the data stream and each
backing index to the output of `GET /_data_stream`. An example looks
like:

```
{
  "data_streams" : [
    {
      "name" : "foo-things",
      "indices" : [
        {
          "index_name" : ".ds-foo-things-2025.02.13-000001",
          ...
          "index_mode" : "standard"
        }
      ],
      ...
      "index_mode" : "standard"
    },
    {
      "name" : "logs-foo-bar",
      "indices" : [
        {
          "index_name" : ".ds-logs-foo-bar-2025.02.13-000001",
          ...
          "index_mode" : "logsdb"
        },
        {
          "index_name" : ".ds-logs-foo-bar-2025.02.13-000002",
          ...
          "index_mode" : "logsdb"
        }
      ],
      ...
      "index_mode" : "logsdb",
    }
  ]
}
```
2025-03-06 07:39:58 +11: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
David Turner
77a3d30d26
Remove trappy timeouts from IndicesAliasesRequest (#123987)
Relates #107984
2025-03-05 02:11:50 +11:00
Jordan Powers
737ab62393
Enable a sparse doc values index for @timestamp in time-series indices (#123191)
This patch builds on the work done in #122161 by also enabling the sparse doc values index for @timestamp in time-series indices.
2025-03-03 11:29:38 -08: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
Tim Vernum
77bf65d9af Merge main into multi-project 2025-02-25 10:33:53 +11:00
David Turner
d007dae1ad
Remove redundant IndexNameExpressionResolver params (#123258)
Follow-up to #120531 to remove all the now-redundant constructor
parameters.
2025-02-25 04:08:31 +11:00
Tim Vernum
b29682c931 Merge revision b3959b6642 into multi-project 2025-02-21 19:28:00 +11:00
Keith Massey
41dae025e7
Updating TransportRolloverAction.checkBlock so that non-write-index blocks do not prevent data stream rollover (#122905) 2025-02-20 17:20:44 +01:00
Tim Vernum
5b2f1cbdaa Merge revision 1c368c7d42 into multi-project 2025-02-19 21:37:04 +11:00
Niels Bauman
1c368c7d42
Remove trappy timeouts from GetSettingsRequest (#122855)
Relates #107984
2025-02-19 09:03:52 +01:00
Tim Vernum
927e67bc5d Merge main into multi-project 2025-02-18 00:19:44 +11: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
Yang Wang
b4d60b0c01 Merge main into multi-project 2025-02-06 14:15:37 +11:00
Jordan Powers
e3e474c337
Copy metrics and default_metric properties when downsampling aggregate_metric_double (#121727)
Fixes #119696 and #96076
2025-02-06 00:32:14 +01:00
Yang Wang
38d74f7408 Merge main into multi-project 2025-02-06 10:04:49 +11: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
Yang Wang
fee57daf53 Merge main into multi-project 2025-02-05 11:03:29 +11:00
James Baiera
59fc3834fd
Return failure store status on ingest failures for data streams without failure store enabled (#121544)
Updates the on failure handler to accept the additional context required to report to the client whether 
or not the document could have been rerouted if failure store was enabled.

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-02-04 14:16:26 -05:00
Slobodan Adamović
d1beb01d27
Disable queryable built-in roles feature for core and datastream YAML tests (#121541)
This PR disables the "queryable built-in roles" feature for the `CoreWithSecurityClientYamlTestSuiteIT` and `DataStreamsClientYamlTestSuiteIT` YAML test suites. 
The feature was enabled by default in the #120323 PR, which asynchronously creates the `.security` index after cluster formation and indexes all built-in roles. The asynchronous creation of the `.security` index introduces non-deterministic behavior in our YAML tests. 
Since these test suites are not intended to verify the queryable built-in roles functionality, having the feature enabled introduced flakiness and unnecessary complexity to handle `.security` in existing tests. These tests would have to exclude the `.security` index in some way (by adjusting permissions or API calls), and in the end cleanup (delete) the `.security` index. This simply adds overhead without much gain. The feature is already test covered by `XPackRestIT` and other integration/REST tests, disabling it here would not compromise test coverage. Instead, it ensures these suites remain deterministic and focused on the behaviors they were designed to verify.

Resolves https://github.com/elastic/elasticsearch/issues/121536 
Resolves https://github.com/elastic/elasticsearch/issues/121513 
Resolves https://github.com/elastic/elasticsearch/issues/121484 
Resolves https://github.com/elastic/elasticsearch/issues/121478 
Resolves https://github.com/elastic/elasticsearch/issues/121290 
Resolves https://github.com/elastic/elasticsearch/issues/121246 
Resolves https://github.com/elastic/elasticsearch/issues/121242 
Resolves https://github.com/elastic/elasticsearch/issues/121238 
Resolves https://github.com/elastic/elasticsearch/issues/121186 
Resolves https://github.com/elastic/elasticsearch/issues/121131 
Resolves https://github.com/elastic/elasticsearch/issues/121130 
Resolves https://github.com/elastic/elasticsearch/issues/121128 
Resolves https://github.com/elastic/elasticsearch/issues/121014 
Resolves https://github.com/elastic/elasticsearch/issues/120965 
Resolves https://github.com/elastic/elasticsearch/issues/120920 
Resolves https://github.com/elastic/elasticsearch/issues/120890
2025-02-04 14:38:36 +01:00
Niels Bauman
7b430dd050 Make system index cleanup project-aware 2025-02-04 13:32:21 +10:00
Niels Bauman
621a18d947 Merge main into multi-project 2025-01-30 17:26:28 +10:00
Nhat Nguyen
9d90d05a50
Allow unmapped fields in MultiClustersIT tests (#120873)
The message_id field may be unmapped if documents were indexed into some 
indices but not all. This change specifies the unmapped type for
message_id, allowing it to be sorted in such cases.

Closes #120796
2025-01-27 07:54:23 -08:00
Mary Gouseti
0fabaf7716
[Bug] Data stream stats fails when there is a concrete index in the cluster (#120901) 2025-01-27 17:42:49 +02:00