Commit graph

674 commits

Author SHA1 Message Date
Simon Cooper
126cf6c0a8
Remove java.time date-time parsing fallback (#116572)
Only use the ISO date-time parser now
2024-11-13 11:48:05 +00:00
Niels Bauman
59f810f290 Allow putting and deleting component templates into multiple projects (MP-1757)
Updates both the PUT and DELETE _component_template APIs to be
project-aware.
2024-11-07 12:55:47 -03:00
Niels Bauman
f9c206c1be Allow putting index templates into multiple projects (MP-1754)
Allows the PUT _index_template API to support multiple projects.
2024-11-06 11:03:22 -03:00
Tim Vernum
2ba2d2a995 Merge main into multi-project 2024-10-31 11:55:04 +11:00
Kostas Krikellas
b97b6637a6
[TEST] Run tsdb tests with both base and trial licenses (#115653)
* Run tsdb tests with both base and trial licenses.

* ignore license error in serverless

* update

* update

* update
2024-10-29 09:57:03 +02:00
Yang Wang
1206819628 Merge remote-tracking branch 'stateful/main' into tmp 2024-10-25 19:14:05 +11:00
Matteo Piergiovanni
7f573c6c28
Only aggregations require at least one shard request (#115314)
* unskipping shards only when aggs

* Update docs/changelog/115314.yaml

* fixed more tests

* null check for searchRequest.source()
2024-10-25 08:50:05 +02:00
Niels Bauman
b5d16f1010 Make cluster health API project-aware (MP-1668)
This commit allows the cluster health API to function in a multi-project
setting. Note: the API is only able to operate on a single project per
request. In the future, we might want to consider changing the API to
allow for multi-project responses, but that's a discussion for later.

This is part of an ongoing effort to get the cleanup part of integration
tests to work in a multi-project setting.
2024-10-25 16:49:27 +11:00
Tim Vernum
fd55e00fa7 Merge main into multi-project 2024-10-25 14:21:13 +11:00
Mary Gouseti
e0a458441c
[Failure store - selector syntax] Introduce the ::* selector (#115389)
**Introduction**

> In order to make adoption of failure stores simpler for all users, we
are introducing a new syntactical feature to index expression
resolution: The selector. > > Selectors, denoted with a :: followed by a
recognized suffix will allow users to specify which component of an
index abstraction they would like to operate on within an API call. In
this case, an index abstraction is a concrete index, data stream, or
alias; Any abstraction that can be resolved to a set of indices/shards.
We define a component of an index abstraction to be some searchable unit
of the index abstraction. > > To start, we will support two components:
data and failures. Concrete indices are their own data components, while
the data component for index aliases are all of the indices contained
therein. For data streams, the data component corresponds to their
backing indices. Data stream aliases mirror this, treating all backing
indices of the data streams they correspond to as their data component.
>  > The failure component is only supported by data streams and data
stream aliases. The failure component of these abstractions refer to the
data streams' failure stores. Indices and index aliases do not have a
failure component.

For more details and examples see
https://github.com/elastic/elasticsearch/pull/113144. All this work has
been cherry picked from there.

**Purpose of this PR**

This PR is introducing the `::*` as another selector option and not as a
combination of `::data` and `::failure`. The reason for this change is
that we need to differentiate between:

- `my-index::*` which should resolve to `my-index::data` only and not to `my-index::failures` and
- a user explicitly requesting `my-index::data, my-index::failures` which should result potentially to an error.
2024-10-24 19:55:54 +11:00
Simon Cooper
b2e0685ca1 Make BulkOperation multi-project aware (MP-1714) 2024-10-23 13:20:07 +01:00
Tim Vernum
8d79154cf1 Merge main into multi-project 2024-10-23 14:24:30 +11:00
Mary Gouseti
e6e147e93b
Adjust failure store to work with TSDS (#114307)
In this PR we add a test and we fix the issues we encountered when we
enabled the failure store for TSDS and logsdb.

**Logsdb** Logsdb worked out of the box, so we just added the test that
indexes with a bulk request a couple of documents and tests how they are
ingested.

**TSDS** Here it was a bit trickier. We encountered the following
issues:

- TSDS requires a timestamp to determine the write index of the data stream meaning the failure happens earlier than we have anticipated so far. We added a special exception to detect this case and we treat it accordingly.
- The template of a TSDS data stream sets certain settings that we do not want to have in the failure store index. We added an allowlist that gets applied before we add the necessary index settings. 

Furthermore, we added a test case to capture this.
2024-10-22 18:36:06 +11:00
Tim Vernum
d4e4b5abb0 Merge main into multi-project 2024-10-22 13:03:12 +11:00
Luca Cavanna
8efd08b019
Upgrade to Lucene 10 (#114741)
The most relevant ES changes that upgrading to Lucene 10 requires are:

- use the appropriate IOContext
- Scorer / ScorerSupplier breaking changes
- Regex automaton are no longer determinized by default
- minimize moved to test classes
- introduce Elasticsearch900Codec
- adjust slicing code according to the added support for intra-segment concurrency
- disable intra-segment concurrency in tests
- adjust accessor methods for many Lucene classes that became a record
- adapt to breaking changes in the analysis area

Co-authored-by: Christoph Büscher <christophbuescher@posteo.de>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: ChrisHegarty <chegar999@gmail.com>
Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
Co-authored-by: Armin Braun <me@obrown.io>
Co-authored-by: Panagiotis Bailis <pmpailis@gmail.com>
Co-authored-by: Benjamin Trent <4357155+benwtrent@users.noreply.github.com>
2024-10-21 13:38:23 +02:00
Kostas Krikellas
5645240976
SyntheticSourceIndexSettingsProvider restores stored source (#114978)
* SyntheticSourceIndexSettingsProvider restores stored source

* remove asserts

* add and fix tests

* fix test

* more tests

* fix assert

* remove assert
2024-10-21 11:32:07 +03:00
Tim Vernum
883471e3b2 Merge main into multi-project 2024-10-21 16:35:42 +11:00
Mary Gouseti
5dec36e9fb
Replace IntermittentLongGCDisruption with blocking cluster state updates (#115075)
In JDK 23 `Thread.resume` has been removed this means that we cannot use
`IntermittentLongGCDisruption` that depends on it. 

We simulate the master node disruption with a `CyclicBarrier` that
blocks cluster state updates.

Closes: https://github.com/elastic/elasticsearch/issues/115045

The backport will close:
https://github.com/elastic/elasticsearch/issues/112634
2024-10-18 20:16:33 +11:00
Albert Zaharovits
1defecfead Merge main into multi-project 2024-10-17 19:28:15 +03:00
Oleksandr Kolomiiets
441eea7d24
Move logsdb tests to logsdb plugin (#114952) 2024-10-17 08:32:10 -07:00
Tim Vernum
ad798a15af Merge main into multi-project 2024-10-17 18:13:14 +11:00
Mary Gouseti
5271b20b64
[Failure store - selector syntax] Replace failureOptions with selector options internally. (#114812)
**Introduction**

> In order to make adoption of failure stores simpler for all users, we
are introducing a new syntactical feature to index expression
resolution: The selector. > > Selectors, denoted with a :: followed by a
recognized suffix will allow users to specify which component of an
index abstraction they would like to operate on within an API call. In
this case, an index abstraction is a concrete index, data stream, or
alias; Any abstraction that can be resolved to a set of indices/shards.
We define a component of an index abstraction to be some searchable unit
of the index abstraction. > > To start, we will support two components:
data and failures. Concrete indices are their own data components, while
the data component for index aliases are all of the indices contained
therein. For data streams, the data component corresponds to their
backing indices. Data stream aliases mirror this, treating all backing
indices of the data streams they correspond to as their data component.
>  > The failure component is only supported by data streams and data
stream aliases. The failure component of these abstractions refer to the
data streams' failure stores. Indices and index aliases do not have a
failure component.

For more details and examples see
https://github.com/elastic/elasticsearch/pull/113144. All this work has
been cherry picked from there.

**Purpose of this PR**

This PR is replacing the `FailureStoreOptions` with the
`SelectorOptions`, there shouldn't be any perceivable change to the user
since we kept the query parameter "failure_store" for now. It will be
removed in the next PR which will introduce the parsing of the
expressions. 

_The current PR is just a refactoring and does not and should not change
any existing behaviour._
2024-10-16 19:16:50 +11:00
Tim Vernum
524a328819 Merge main into multi-project 2024-10-16 10:29:26 +11:00
Oleksandr Kolomiiets
c401a71426
Make mapping a distinct concept in logsdb data generation (#114370) 2024-10-16 00:24:39 +02:00
Luke Whiting
37f03dc40d
#111893 Add Warnings For Missing Index Templates (#114589)
* Add data stream template validation

to snapshot restore

* Add data stream template validation

to data stream promotion endpoint

* Add new assertion for response headers

Add a new assertion to synchronously execute a request and check the
response contains a specific warning header

* Test for warning header on snapshot restore

When missing templates

* Test for promotion warnings

* Add documentation for the potential error states

* PR changes

* Spotless reformatting

* Add logic to look in snapshot global metadata

This checks if the snapshot contains a matching template for the DS

* Comment on test cleanup to explain it was copied

* Removed cluster service field
2024-10-15 15:00:53 +01:00
Tim Vernum
586d543918 Merge main into multi-project 2024-10-15 15:08:06 +11:00
Martijn van Groningen
8c3d19badc
Update IndexSettingProvider#getAdditionalIndexSettings() signature (#114150)
With logsdb another index mode is available, the isTimeSeries parameter is limiting. Instead, we should just push down the index mode from template to index settings provider.

Follow up from #113451
Relates to #113583
2024-10-14 16:27:37 +02:00
Mary Gouseti
51ea024eda
Introduce CRUD APIs for data stream options (#113945)
In this PR we introduce two endpoint PUT and GET to manage the data
stream options and consequently the failure store configuration on the
data stream level. This means that we can manage the failure store of
existing data streams.

The APIs look like:

```
# Enable/disable 
PUT _data_stream/my-data-stream/_options
{
  "failure_store": {
    "enabled": true
  }
}

# Remove existing configuration
DELETE _data_stream/my-data-stream/_options

# Retrieve 
GET _data_stream/my-data-stream/_options
{
  "failure_store": {
    "enabled": true
  }
}
```

Future work:

- Document the new APIs
- Convert `DataStreamOptionsIT.java` to a yaml test.
2024-10-15 00:02:24 +11:00
Tim Vernum
1c62e4f533 Merge main into multi-project 2024-10-14 16:30:28 +11:00
Oleksandr Kolomiiets
a62228a744
Allow stored source in logsdb and tsdb (#114454) 2024-10-11 11:16:55 -07:00
Mary Gouseti
d8406e4752
[Failure store - selector syntax] Refactor IndicesOptions builder (#114597)
**Introduction**

> In order to make adoption of failure stores simpler for all users, we
are introducing a new syntactical feature to index expression
resolution: The selector. > > Selectors, denoted with a :: followed by a
recognized suffix will allow users to specify which component of an
index abstraction they would like to operate on within an API call. In
this case, an index abstraction is a concrete index, data stream, or
alias; Any abstraction that can be resolved to a set of indices/shards.
We define a component of an index abstraction to be some searchable unit
of the index abstraction. > > To start, we will support two components:
data and failures. Concrete indices are their own data components, while
the data component for index aliases are all of the indices contained
therein. For data streams, the data component corresponds to their
backing indices. Data stream aliases mirror this, treating all backing
indices of the data streams they correspond to as their data component.
>  > The failure component is only supported by data streams and data
stream aliases. The failure component of these abstractions refer to the
data streams' failure stores. Indices and index aliases do not have a
failure component.

For more details and examples see
https://github.com/elastic/elasticsearch/pull/113144. All this work has
been cherry picked from there.

**Purpose of this PR**

This PR is replacing the the indices options boolean constructor with
the builders. The goal is to give me and the reviewer a very narrow
scope change when we can ensure we did not make any mistakes during the
conversion. Also it will reduce a bit the change list in
https://github.com/elastic/elasticsearch/pull/113144/files.
2024-10-12 00:39:50 +11:00
Kostas Krikellas
34da953571
[TEST] Add coverage for field caps and ES|QL to LogsDB QA testing (#114505)
* Add coverage for field caps and ES|QL to LogsDB QA testing

* address comments

* address comments

* address comments
2024-10-11 08:01:17 +03:00
Simon Cooper
f981d1f9e2 Merge remote-tracking branch 'upstream-main/main' into update-main-10-10-24 2024-10-10 13:27:33 +01:00
Mary Gouseti
0d03207477
Clean up factory retention settings from elasticsearch (#114396)
This removes the possibility for a plugin to provide factory retention settings. Factory retention settings have been deprecated and completely replaced by #111972.

Note: this feature is not in use. If someone wants to set global retention they can use the cluster settings as defined in #111972.
2024-10-10 11:45:46 +03:00
Albert Zaharovits
36fcdb5d0b Merge main into multi-project 2024-10-06 13:54:49 +03:00
Oleksandr Kolomiiets
c1f2f80c94
Correctly inject subobjects parameter in logsdb tests (#113643) 2024-10-04 14:54:03 -07:00
David Turner
f27411ee12
Assert that REST params are consumed iff supported (#114040)
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes #113854
2024-10-04 05:55:59 +01:00
David Turner
d3dbbb29b3
Revert "Assert that REST params are consumed iff supported (#113933)"
This reverts commit 6d7ae82180.
This reverts commit a5ef139616.
2024-10-03 16:52:40 +01:00
David Turner
6d7ae82180
Assert that REST params are consumed iff supported (#113933)
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes #113854
2024-10-03 06:44:28 +01:00
David Turner
1964d3c5ea
Ensure that supported params are computed once (#113953)
A few of today's REST handler implementations compute a new set of
supported parameters on each request. This is needlessly inefficient
since the set never changes. This commit fixes those implementations and
adds assertions to verify that we are returning the exact same instance
each time.
2024-10-02 20:59:39 +01:00
Salvatore Campagna
521e4341d7
ignore_above default to 8191 for logsdb (#113442)
In LogsDB we would like to use a default value of `8191` for the index-level setting
`index.mapping.ignore_above`. The value for `ignore_above` is the _character count_,
but Lucene counts bytes. Here we set the limit to `32766 / 4 = 8191` since UTF-8
characters may occupy at most 4 bytes.
2024-10-02 15:02:43 +02:00
Gergely Kalapos
644fd047c9
Make xpack.otel_data.registry.enabled default to true (#113468)
* Make xpack.otel_data.registry.enabled default to true

* Update build.gradle

* Disable otel-data plugin for tests where it's not relevant

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-01 16:29:37 +02:00
Albert Zaharovits
d8e2b88cdc Merge main into multi-project 2024-10-01 09:48:59 +03:00
Mary Gouseti
76c2d8dc5e
Move the failure store enable flag into the data stream options (#113176) 2024-09-30 15:32:16 +03:00
Salvatore Campagna
487c5562aa
Remove cluster.logsdb.enabled from StackPlugin (#113616)
After introducing #113505 we need to remove `cluster.logsdb.enabled` from
`StackPlugin` and `StackTemplateRegistry`.
2024-09-30 10:03:34 +02:00
Kostas Krikellas
c9f378da29
Revert "Apply auto-flattening to subobjects: auto (#112092)" (#113692)
* Revert "Apply auto-flattening to `subobjects: auto` (#112092)"

This reverts commit fffe8844

* fix DataGenerationHelper
2024-09-30 10:11:15 +03:00
Oleksandr Kolomiiets
3a5134350b
Add a logsdb test that uses ignored dynamic fields (#113639) 2024-09-27 08:10:14 -07:00
Nhat Nguyen
ee24f84df0
Add CCS tests for logsdb (#113658)
Closes #109805
2024-09-27 07:10:23 -07:00
Martijn van Groningen
26d542833c
Keep track of logsdb at data stream level. (#113451)
Today we keep track of a data stream's index mode. However if index mode
is logsdb, then we don't set it at data stream level. We only set it is
index mode is time series.

This change keeps track of logsdb index mode at data stream creation and
rollover time.

Followup changes: * Update the get data stream api to return that a data
stream is in logsdb mode. (today we do return additional information in
case of time series data stream) * Update the
IndexSettingProvider#getAdditionalIndexSettings(...) parameter list by
including `indexMode` instead of `isTimeSeries`.

Relates to #113583
2024-09-27 21:49:15 +10:00
Niels Bauman
11d8665d99 Merge main into multi-project
# Conflicts:
#	.buildkite/hooks/pre-command
2024-09-26 14:07:03 -03:00