Commit graph

350 commits

Author SHA1 Message Date
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
Artem Prigoda
c28b54de7b
[9.0] Don't return or accept node_version in the Desired Nodes API (#119049) (#121775)
Backports #119049 to 9.0

>  Re-submission of #114580
>  node_version was deprecated in #104209 (8.13) and shouldn't be set or returned in 9.0
2025-02-06 04:59:51 +11:00
Mary Gouseti
8ff5ac8b05
DeprecationInfoAction refactoring (#121181) (#121638)
This refactoring was motivated by the following issues with the current
state of the code:

- The `TransformDeprecationChecker` is listed as plugin checker, but later we remove is from the `plugin_settings` and add it to the `cluster_settings`. This made me consider that the checker might be dealing with transform deprecation warnings but if they are listed under the `cliuster_settings`, it fits better to be part of `ClusterDeprecationChecker`.
- The `DeprecationInfo` is a data class, but it has a method `from` which constructs an `DeprecationInfo.Response` instance. However, this is not a simple factory class but it actually runs all the checks and it also tries to assert that it is not executed on a transport thread. Considering this, I thought it might fit better to the `TransportDeprecationInfoAction`, this way all the logic is in one place and all the checkers are wired and used in the same class.
- Constructing the node settings deprecation issues requires to merge the deprecation warnings of the individual nodes. We considered bringing together the execution of the remote request and the construction of the response in a new class called `NodeDeprecationChecker` that resembles the patterns of the other Checker classes.
- Reinstated the `PLUGIN_CHECKERS` even if we have only one check, so other developers can easier add their plugin checks.
- Finally, we noticed that the way we synthesise the remote requests is difficult to read and maintain because each call is nested under the previous one. We propose in this PR a different pattern that uses the `RefCountingListener` to combine the different remote calls and store their results in a container class named `PrecomputedData`
- **Bonus**: Removed the `LegacyIndexTemplateDeprecationChecker.java` which was not used.
2025-02-04 14:41:19 +02:00
Benjamin Trent
038aab864e
Mark bbq indices as GA and add rolling upgrade integration tests (#121105)
With the introduction of our new backing algorithm and making rescoring
easier with the `rescore_vector` API, let's mark bbq as GA. 

Additionally, this commit adds rolling upgrade tests to ensure
stability.
2025-01-30 01:58:08 +11:00
Martijn van Groningen
952bf229fb
Conditionally enable logsdb by default (#121049)
Enable logsdb by default if logsdb.prior_logs_usage has not been set to true.

Meaning that if no data streams were created matching with the logs-- pattern in 8.x, then logsdb will be enabled by default for data streams matching with logs-*-* pattern.

Also removes LogsPatternUsageService as with version 9.0 and beyond, this component is no longer necessary.

Followup from #120708
Closes #106489
2025-01-29 15:03:28 +01:00
Mary Gouseti
7322015761
[Deprecation API] Refactor resource deprecation checkers and add new resources. (#120505) 2025-01-28 13:00:27 +02:00
Martijn van Groningen
cd10b05162
Turn _source meta fieldmapper's mode attribute into a no-op. (#119072)
Closes #118596
2025-01-24 09:25:55 +01:00
Tanguy Leroux
93bc7581ad
Follow ups after Add Index Block API changes for N-2 support (#120526)
This change contains follows ups now the Add Index Block API change is
merged.

The index setting `index.verified_read_only`can now be `PrivateIndex`
and not `Dynamic` anymore. Regular indices in version N-2 can recover if
they have the `index.block.read_only` too. And finally, upgrade tests
can use the Add Index Block API instead of manually flushing and adding
blocks explicitly.

This change requires #120537 for `8.x` (tests will fail until it is
merged).

Relates #119743 Relates #120522
2025-01-22 21:40:22 +11:00
Henning Andersen
5e8cce2187
Mark read-only flush and verify (#119743)
When marking read-only now flush and mark index as verified guaranteeing
that we can upgrade safely to next version with N-1 indices (becoming N-2).
Use this in the deprecation check.
2025-01-21 12:04:45 +01:00
Simon Cooper
a2d84b1b90
Remove assumed features in server for 9.0 (#119946)
All features added before 8.18 can now be assumed and removed in 9.0
2025-01-15 08:37:04 +00:00
Simon Cooper
c41897e9c4
Remove the features supported feature (#119758)
This removes the features_supported feature from the codebase, as all nodes communicable with 9.0 will support features
2025-01-09 15:17:22 +00:00
Niels Bauman
21fe5a9749
Unmute FieldCapsIT.testAllIndicesWithIndexFilter (#119182)
This was muted a while ago due to index template BwC issues. These were
addressed in #109166, so we should be able to unmute this test too.
2024-12-23 19:10:10 +01:00
Joe Gallo
537f4ce871
Fix log message format bugs (#118354) 2024-12-10 15:01:53 -05:00
Nhat Nguyen
631345f965
Adjust index version for deprecating source mode (#117183)
There was a bug in the version-checking logic for emitting deprecation 
warnings for source.mode in mappings.
2024-11-25 10:20:58 -08:00
Rene Groeschke
f6ac6e1c3b
[Build] Remove deprecated BuildParams (#116984) 2024-11-22 16:30:57 +01:00
Nhat Nguyen
fe7818af04
Deprecate _source.mode in mappings (#117172)
Re-introduce #116689
2024-11-20 10:27:44 -08:00
Simon Cooper
c2c0901bba
Remove desired node historical features (#116951) 2024-11-20 15:57:14 +00:00
Martijn van Groningen
ac06a84e0a
Revert "Deprecate _source.mode in mappings (#116689)" (#117150)
This reverts commit 0d7b90e22a, because of bwc testing failures.
2024-11-20 13:38:26 +01:00
Nhat Nguyen
0d7b90e22a
Deprecate _source.mode in mappings (#116689)
This change deprecates _source.mode in mappings, replacing it with the 
index.mapping.source.mode index setting.
2024-11-19 17:53:52 -08:00
Simon Cooper
b17674b48a
Remove REST historical features (#116929) 2024-11-19 15:42:34 +00:00
Simon Cooper
08daf65592
Remove health historical features and upgrade test (#116928) 2024-11-18 14:30:11 +00:00
Rene Groeschke
13c8aaeffa
[Gradle] Remove static use of BuildParams (#115122)
Static fields dont do well in Gradle with configuration cache enabled.

- Use buildParams extension in build scripts
- Keep BuildParams.ci for now for easy serverless migration
-  Tweak testing doc
2024-11-15 17:58:57 +01:00
Martijn van Groningen
61829213cf
Tweak Logsdb* and TsdbIndexingRollingUpgradeIT (#115850)
Adjust assertion to more losely detect an error that can be ignored.

Closes #115817
2024-10-29 17:14:50 +01:00
Johannes Fredén
a7031d8716
Add ECK Role Mapping Cleanup (#115823)
* Add security migration for cleaning up ECK role mappings
2024-10-29 12:31:02 +01:00
Artem Prigoda
ef2cf37a6d
Revert "Don't return or accept node_version in the Desired Nodes API (#114580)" (#115829)
This reverts commit c64226c350.
2024-10-29 12:03:19 +01:00
Martijn van Groningen
232622afd3
Tweak LogsdbIndexingRollingUpgradeIT and TsdbIndexingRollingUpgradeIT (#115785)
to fix following test bugs:
* Deal with trail already started error.
* Ensure k8s.pod.name field is mapped as keyword

Closes #115755, #115756, #115757, #115758, #115758
2024-10-28 18:02:19 +01:00
Martijn van Groningen
98cd34f3fd
Add more tsdb and logsdb rolling upgrade indexing tests. (#115639)
The main difference between other rolling upgrade tests is that these tests index more data while performing the rolling upgrade and no rollover is performed during rolling upgrade. For example this makes it more likely for merging to happen, which could uncover bwc bugs.

Note that currently both test suites start trial license so that synthetic source gets used.
2024-10-28 08:34:48 +01:00
Artem Prigoda
c64226c350
Don't return or accept node_version in the Desired Nodes API (#114580)
It was deprecated in #104209 (8.13) and shouldn't be set or returned in 9.0

The Desired Nodes API is an internal API, and users shouldn't depend on its backward compatibility.
2024-10-24 18:19:14 +02:00
Ryan Ernst
7544c88c12
Consolidate @Before of rolling upgrade tests (#114677)
Multiple @Before methods in junit are run in random order. This commit
cosolidates the @Before methods of ParameterizedRollingUpgradeTestCase
since the code has interdependencies.

closes #114330
2024-10-23 10:29:05 -07:00
Nikolaj Volgushev
c6bd53f21b
Fix FileSettingsRoleMappingUpgradeIT assertions (#115422)
Fixes some faulty assertions in an upgrade test. Test failures only
manifest on the 8.16 branch since 9.x does not qualify for these upgrade
tests, and the change is not backported to 8.17 yet (unrelated CI
failures).

I validated this works by running it locally from the 8.16 branch.

Resolves: https://github.com/elastic/elasticsearch/issues/115410
Resolves: https://github.com/elastic/elasticsearch/issues/115411
2024-10-24 02:17:38 +11:00
Nikolaj Volgushev
6855db5b44
Expose cluster-state role mappings in APIs (#114951)
This PR exposes operator-defined, cluster-state role mappings in the
[Get role mappings
API](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html).


Cluster-state role mappings are returned with a reserved suffix
`-read-only-operator-mapping`, to disambiguate with native role mappings
stored in the security index. CS role mappings are also marked with a
`_read_only` metadata flag. It's possible to query a CS role mapping
using its name both with and without the suffix.  

CS role mappings can be viewed via the API, but cannot be modified. To
clarify this, the PUT and DELETE role mapping endpoints return header
warnings if native role mappings that name-clash with CS role mappings
are created, modified, or deleted. 

The PR also prevents the creation or role mappings with names ending in
`-read-only-operator-mapping` to ensure that CS role mappings and native
role mappings can always be fully disambiguated.

Finally, the PR changes how CS role mappings are persisted in
cluster-state. CS role mappings are written (and read from disk) in the
`XContent` format. This format omits the role mapping's name. This means
that if CS role mappings are ever recovered from disk (e.g., during a
master-node restart), their names are erased. To address this, this PR
changes CS role mapping serialization to persist the name of a mapping
in a reserved metadata field, and recover it from metadata during
serialization. This allows us to persist the name without BWC-breaks in
role mapping `XContent` format. It also allows us to ensure that role
mappings are re-written to cluster state in the new, name-preserving
format the first time operator file settings are processed.

Depends on: https://github.com/elastic/elasticsearch/pull/114295
Relates: ES-9628
2024-10-23 01:34:11 +11:00
Nikolaj Volgushev
78a43981b6
Reprocess operator file settings on service start (#114295)
Changes `FileSettingsService` to reprocess file settings on every
restart or master node change, even if versions match between file and
cluster-state metadata. If the file version is lower than the metadata
version, processing is still skipped to avoid applying stale settings. 

This makes it easier for consumers of file settings to change their
behavior w.r.t. file settings contents. For instance, an update of how
role mappings are stored will automatically apply on the next restart,
without the need to manually increment the file settings version to
force reprocessing. 

Relates: ES-9628
2024-10-21 20:18:26 +11:00
Martijn van Groningen
8e3b3aa1a5
No longer require logs@settings component template to enable logsdb by default. (#114501)
This change also opts out apm logs from logsdb.
2024-10-10 20:12:17 +02:00
David Turner
07c3acf1c0
Remove cluster state from /_cluster/reroute response (#114231)
Including the cluster state in responses to the `POST _cluster/state`
API  was deprecated in #90399 (v8.6.0) requiring callers to pass
`?metric=none` to avoid the deprecation warning. This commit adjusts the
behaviour as promised in v9 so that this API never returns the cluster
state, and deprecates the `?metric` parameter itself.

Closes #88978
2024-10-08 07:59:57 +01:00
Lorenzo Dematté
fcdfa5b18e
Remove some easy/straightforward instances of UpdateForV9 (#114134) 2024-10-04 17:07:35 +02:00
David Turner
81bd8667cb
Define owners for UpdateForV9 annotations (#113926)
In order to better track the work needed to prepare this branch for the
major version upgrade, this commit adds a mandatory `owner` field to all
`UpdateForV9` (and `UpdateForV10`) annotations.
2024-10-02 11:37:14 +01:00
Luca Cavanna
bb78a28c4a
Remove index.mapper.dynamic setting (#113000)
This setting had been removed in the past, it was reintroudced for bw comp with 7.x with #109341. It can now be removed from main as it no longer supports indices created with 7.x
2024-09-18 10:10:44 +02:00
Mark Vieira
a59c182f9f
Add AGPLv3 as a supported license 2024-09-13 15:29:46 -07:00
Armin Braun
bf7be8e23a
Save 400 LoC in tests by using indexSettings shortcut (#111573)
It's in the title, randomly saw a bunch of spots where we're
not using the shortcut, figured I'd clean this up quickly to save ~400 lines.
2024-08-05 10:21:13 +02:00
Salvatore Campagna
2fa5400e23
Test LogsDB backward compatibility (#110180)
Test LogsDB backward compatibility with a rolling upgrade and full cluster restart.
We try to start indexing logs using a `standard` index, then we switch to a `LogsDB` index.
We also improve the existing test which switches between the two index modes, `standard`
and `logs`.
2024-07-25 15:15:27 +02:00
Simon Cooper
ede4038827
Fix FileSettingsUpgradeIT to not create irrelevant clusters at all (#110963) 2024-07-17 12:00:06 +01:00
Simon Cooper
bdedced586
Add test for upgrading to ES with file settings (#110229) 2024-07-10 09:01:32 +01:00
Benjamin Trent
411ff56458
Always refresh indices to ensure vectors are searchable in VectorSearchIT (#109864)
There are some weird failures here and there indicating that a segment
might not have been flushed and refreshed for search.

Related: https://github.com/elastic/elasticsearch/issues/109628
2024-06-19 03:16:28 +10:00
Benjamin Trent
3aed0afb2b
Add new int4 quantization to dense_vector (#109317)
This adds a new quantization mechanism for HNSW and flat indices. Here
we add `int4` quantization via the `int4_hnsw` and `int4_flat` index
types. This quantization methodology further reduces the memory required
for fast HNSW, meaning that the memory required is 8x smaller than with
regular float32 values. 

8x reduction means that 1M 1024 dimension vectors goes from requiring
3.8GB to 477MB.

Recall continues to stay steady, there is some reduction that is
recoverable via slightly oversampling and reranking. For example over
500k CohereV3 vectors, only 5 extra vectors are required to be gathered
to achieve over 0.98 recall in a brute-force scenario.

![recall](b47a79d0-020d-4baa-8199-41a932df00f7)
2024-06-18 00:15:43 +10:00
Tommaso Teofili
67f85ebea0
DenseVectorMappingUpdateIT BWC fix (#109620) 2024-06-12 13:38:32 +02:00
Martijn van Groningen
696191d1c7
Fix testMapperDynamicIndexSetting() failures (#109574)
Currently these tests run against any old cluster older than 8.0.0, but
the fix that allowed `index.mapper.dynamic` to exist is only available
in 7.17.22.

Adjust these tests to only run if old cluster is after version 7.17.21
and before 8.0.0
2024-06-12 12:06:41 +10:00
Martijn van Groningen
09fc32090c
Re-define index.mapper.dynamic setting in 8.x (#109341)
Currently when upgrading a 7.x cluster to 8.x with
`index.mapper.dynamic` index setting defined the following happens:

- In case of a full cluster restart upgrade, then the index setting gets archived and after the upgrade the cluster is in a green health.
- In case of a rolling cluster restart upgrade, then shards of indices with the index setting fail to allocate as nodes start with 8.x version. The result is that the cluster has a red health and the index setting isn't archived. Closing and opening the index should archive the index setting and allocate the shards.

The change is about ensuring the same behavior happens when upgrading a
cluster from 7.x to 8.x with indices that have the
`index.mapper.dynamic` index setting defined.  By re-defining the
`index.mapper.dynamic `index setting with
`IndexSettingDeprecatedInV7AndRemovedInV8` property, the index is
allowed to exist in 7.x indices, but can't be defined in new indices
after the upgrade. This way we don't have to rely on index archiving and
upgrading via full cluster restart or rolling restart will yield the
same outcome.

Based on the test in #109301. Relates to #109160 and #96075
2024-06-11 18:17:48 +10:00
Tommaso Teofili
7e7f8a379a
Make dense vector field type updatable (#106591) 2024-06-10 18:39:02 +02:00
Simon Cooper
d6cb12ec8f
Properly support capabilities checks with mixed version clusters (#108513)
When a capabilities check is done on a cluster with some nodes that do not support capabilities, always return false
2024-05-10 16:29:01 +01:00
Mark Vieira
2f94aeea0c
Refactor rolling upgrade tests to make it easier to customize (#108393) 2024-05-08 08:25:44 -07:00