Commit graph

674 commits

Author SHA1 Message Date
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
Slobodan Adamović
52e0f21bdd
Enable queryable built-in roles feature by default (#120323)
Making the `es.queryable_built_in_roles_enabled` feature flag enabled by default.
This feature makes the built-in roles automatically indexed in `.security` index and available
for querying via Query Role API. The consequence of this is that `.security` index is now 
created eagerly (if it's not existing) on cluster formation.

In order to keep the scope of this PR small, the feature is disabled for some of the tests, 
because they are either non-trivial to adjust or the gain is not worthy the effort to do it now. 
The tests will be adjusted in a follow-up PR and later the flag will be removed completely.

Relates to #117581
2025-01-27 10:25:54 +01:00
Dimitris Rempapis
66db8c7d4c
Test/107515 RestoreTemplateWithMatchOnlyTextMapperIT (#120392)
Update the way of comparing stateMaps for equality
2025-01-24 15:47:44 +02:00
Niels Bauman
6495dcbb40 Merge main into multi-project 2025-01-24 15:48:39 +10:00
Mary Gouseti
77ef1d41a0
Failure store - No selectors in snapshots (#120114)
In this PR we explore how we can include the failure store indices while
disallowing the user to use selectors in the `indices` field of the
create and restore snapshot requests.

**Security concerns**

The create and restore snapshot require cluster privileges only, so we
do not have to worry about how to handle index level security (see
[Create Snapshot
API](https://www.elastic.co/guide/en/elasticsearch/reference/current/create-snapshot-api.html#create-snapshot-api-prereqs)
& [Restore Snapshot
API](https://www.elastic.co/guide/en/elasticsearch/reference/current/restore-snapshot-api.html#restore-snapshot-api-prereqs)).

**Challenges**

While there are other APIs that do not support selectors but they do
include the failure indices in their response such as `GET
_data_stream/<target>`, `GET _data_stream/<target>/stats`, etc; the
snapshot APIs are a little bit different. The reason for that is that
the data stream APIs first collect only the relevant data streams and
then they select the backing indices and/or the failure indices. On the
other hand, the snapshot API that works with both indices and data
streams cannot take such a shortcut and needs to use the
`concreteIndices` method.

We propose, to add a flag that when the selectors are not "allowed" can
determine if we need to include the failure store or not. In the past we
had something similar called the default selector, but it was more
flexible and it was used a fallback always. 

Our goal now is to only specify the behaviour we want when the selectors
are not supported. This new flag allowed also to simplify the concrete
index resolution in `GET _data_stream/<target>/stats`

Relates to https://github.com/elastic/elasticsearch/issues/119545
2025-01-24 00:24:45 +11:00
Niels Bauman
3c77133e9c Make Data Stream Lifecycle APIs project aware (MP-1925)
Make remaining Data Stream Lifecycle APIs project aware.
2025-01-23 09:22:30 +00:00
Niels Bauman
1d106a83ed Make migrate data stream API project aware (MP-1928)
Allows migrating aliases to data streams in multi-projects.
2025-01-23 06:42:41 +00:00
Simon Cooper
569c1fc1cd Merge remote-tracking branch 'upstream-main/main' into merge-main-22-01-25T12 2025-01-22 12:22:36 +00:00
Simon Cooper
39601ed683
Remove IndexNameExpressionResolver from base classes that don't use it (#120531) 2025-01-22 10:17:07 +00:00
Niels Bauman
0e64300930 Make modify data stream API project aware (MP-1926)
Makes the modify data stream API (for changing the backing and failure
indices) project aware.
2025-01-21 07:19:52 +00:00
Yang Wang
7a1f5c5d4f Merge main into multi-project 2025-01-20 11:17:40 +11:00
Mary Gouseti
2ee7ca4187
[Failure store] Add failure index retrieval to IndexAbstraction (#119413) 2025-01-17 09:44:35 +02:00
Simon Cooper
5a70623d8d Merge remote-tracking branch 'upstream-main/main' into merge-main-16-01-25 2025-01-16 09:23:46 +00:00
Niels Bauman
9f597a4eb5
Remove trappy timeouts from GetIndexRequest (#120037)
Relates #107984
2025-01-16 16:05:36 +10:00