Commit graph

369 commits

Author SHA1 Message Date
Rene Groeschke
29db3f3464
[Build] Extract logsdb rolling-upgrade tests (#129673)
- introduce separate subproject for testing logsdb rolling-upgrade tests
- should reduce :qa:rolling-upgrade test task durations
2025-06-19 22:04:36 +02:00
Yang Wang
6858c32529
[Test] Allow allocation in mixed cluster (#129680)
The RunningSnapshotIT upgrade test adds shutdown markers to all nodes
and removes them once all nodes are upgraded. If an index gets created
in a mixed cluster, for example by ILM or deprecation messages, the
index cannot be allocated because all nodes are shutting down. Since the
cluster ready check between node upgrades expects a yellow cluster, the
unassigned index prevents the ready check to succeed and eventually
timeout. This PR fixes it by removing shutdown marker for the 1st
upgrade node to allow it hosting new indices.

Resolves: #129644 Resolves: #129645 Resolves: #129646
2025-06-19 20:13:11 +10:00
Tommaso Teofili
629a366baa
Make dense_vector fields updatable to bbq_flat/bbq_hnsw (#128291) 2025-06-16 17:15:59 +02:00
Moritz Mack
9e5cac34a4
Expand bcUpgradeTask to run more test suites. (#128983)
Relates to ES-11904

#128984 contains the changes to the PR buildkite pipeline to test this change while the buildkite changes are not merged yet.
2025-06-13 12:58:49 +02:00
Lorenzo Dematté
385e0d9259
[BC Upgrage] Fix incorrect version parsing in tests (#129243)
This PR introduces several fixes to various IT tests, related to the use and misuse of the version identifier for the start cluster:

    wherever we can, we replace of versions in test code with features
    where we can't, we make sure we use the actual stack version (the one provided by -Dtests.bwc.main.version and not the bogus "0.0.0" version string)
    when requesting the cluster version we make sure we do use the "unresolved" version identifier (the value of the tests.old_cluster_version system property e.g. 0.0.0 ) so we resolve the right distribution

These changes enabled the tests to be used in BC upgrade tests (and potentially in serverless upgrade tests too, where they would have also failed)

Relates to ES-12010

Precedes #128614, #128823 and #128983
2025-06-11 17:22:54 +02:00
Martijn van Groningen
e23a5e7661
Enable security in a number of logsdb and tsdb integration tests. (#128877)
This change enables security in a number of tsdb and logsdb integration tests. A number of java/yaml rest tests in logsdb module, additionally logsdb and tsdb rolling upgrade tests.

A recent bug (#128050) wouldn't have happened if logsdb rolling upgrade tests ran with security enabled.
2025-06-04 17:23:25 +03:00
Mayya Sharipova
080a0cdd89
Enable sort optimization on int, short and byte fields (#127968)
Before this PR sorting on integer, short and byte fields types used
SortField.Type.LONG. This made sort optimization impossible for these
field types.

This PR uses SortField.Type.INT for integer, short and byte fields. This
enables sort optimization.

There are several caveats with changing sort type that are addressed: -
Before mixed sort on integer and long fields was automatically
supported, as both field types used SortField.TYPE.LONG. Now when
merging results from different shards, we need to convert sort to LONG
and results to long values. - Similar for collapsing when there is mixed
INT and LONG sort types. - Index sorting. Similarly, before for index
sorting on integer field, SortField.Type.LONG was used. This sort type
is stored in the index writer config on disk and can't be modified. Now
when providing sortField() for index sorting, we need to account for
index version: for older indices return sort with SortField.Type.LONG
and for new indices return SortField.Type.INT.

---

There is only 1 change that  may be considered not backwards compatible:
Before if an integer field was [missing a
value](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/sort-search-results#_missing_values)
, it sort values will return Long.MAX_VALUE in a search response. With
this integer, it sort valeu will return Integer.MAX_VALUE.  But I think
this change is ok, as in our documentation, we don't provide information
what value will be returned, we just say it will be sorted last. 

---

Also closes #127965 (as same type validation in added for collapse
queries)
2025-06-03 07:50:11 +10:00
Moritz Mack
cdd208704c
Add initial bcUpgradeTask (#128588) 2025-06-02 11:21:51 +02: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
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
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
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
Martijn van Groningen
ea8283e9c8
Avoid serializing empty _source fields in mappings. (#122606) 2025-03-06 12:20:07 +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
feb3a60e98
Add forwards compatibility testing (#123436) 2025-02-26 08:56:30 -08: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
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
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
Mary Gouseti
95c9b4b855
DeprecationInfoAction refactoring (#121181)
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 19:48:17 +11: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