Commit graph

321 commits

Author SHA1 Message Date
Joe Gallo
78fb1ec970
Fix log message format bugs (#118354) (#118387) 2024-12-11 08:59:16 +11:00
Rene Groeschke
581b9ab7c0
[8.16] [Gradle] Remove static use of BuildParams (#115122) (#117434)
* [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

(cherry picked from commit 13c8aaeffa)

# Conflicts:
#	TESTING.asciidoc
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestBasePlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/AbstractYamlRestCompatTestPlugin.java
#	build.gradle
#	modules/ingest-geoip/qa/full-cluster-restart/build.gradle
#	qa/mixed-cluster/build.gradle
#	x-pack/plugin/ent-search/qa/full-cluster-restart/build.gradle
#	x-pack/plugin/eql/qa/rest/build.gradle
#	x-pack/plugin/fleet/qa/rest/build.gradle
#	x-pack/plugin/kql/build.gradle
#	x-pack/plugin/mapper-unsigned-long/build.gradle
#	x-pack/plugin/ml/qa/multi-cluster-tests-with-security/build.gradle
#	x-pack/plugin/security/qa/multi-cluster/build.gradle
#	x-pack/plugin/sql/qa/jdbc/build.gradle
#	x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle

* Fix merge

* [Build] Fix fips testing after buildparams rework (#116934)

* More Cleanup

* [Build] Fix checkstyle exclusions on windows (#115185)

* More merge fixes

* Delete x-pack/plugin/kql/build.gradle
2024-11-27 12:34:32 +01:00
Lorenzo Dematté
b4597a250f
[8.16] Add a cluster listener to fix missing system index mappings after upgrade (#115771) (#116646)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-21 23:27:01 +11:00
Nikolaj Volgushev
add5b2751a
[8.16] Add ECK Role Mapping Cleanup (115823) (#115871)
* Merge

* Fix merge

* Versions

* Nit

---------

Co-authored-by: Johannes Fredén <109296772+jfreden@users.noreply.github.com>
2024-10-30 22:59:57 +11:00
Nikolaj Volgushev
67a7682a4d
Fix FileSettingsRoleMappingUpgradeIT assertions (#115422) (#115468)
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 08:42:50 +11:00
Nikolaj Volgushev
8761f39594
Expose cluster-state role mappings in APIs (#114951) (#115387)
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 19:37:32 +11:00
Nikolaj Volgushev
9b62098ffa
[8.16] Reprocess operator file settings on service start (#114295) (#115190)
Backports https://github.com/elastic/elasticsearch/pull/114295 with following commits:

- 78a43981b6
2024-10-21 13:06:11 +02:00
Martijn van Groningen
1aed889d3a
No longer require logs@settings component template to enable logsdb by default. (#114501) (#114525)
This change also opts out apm logs from logsdb.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-12 06:25:12 +11:00
Mark Vieira
0279c0a909
Add AGPLv3 as a supported license 2024-09-13 14:30:33 -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
eyalkoren
ee262954ee
Adding aggregations support for the _ignored field (#101373)
Enables aggregations on the _ignored metadata field replacing the stored field
with doc values.
2024-04-29 16:41:34 +02:00
Simon Cooper
b6b20a5d6f
Update several references to IndexVersion.toString to use toReleaseVersion (#107828) 2024-04-25 10:37:02 +01:00
Benjamin Trent
65bee01cfe
Loosen error for nearest score in VectorIT#testQuantizedVectorSearch (#107382)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-04-12 12:21:03 -04:00
Moritz Mack
1f5e04b721
Migrate YAML REST tests to synthetic cluster feature check (#107068)
To simplify the migration away from version based skip checks in YAML specs, 
this PR adds a synthetic version feature `gte_vX.Y.Z` for any version at or before 8.14.0.

New test specs for 8.14 or later are expected to use respective new cluster features,
or a test-only feature supplied via ESRestTestCase#createAdditionalFeatureSpecifications
if sufficient.
2024-04-11 18:22:38 +02:00
Max Hniebergall
85577f438c
mute VectorSearchIT.testQuantizedVectorSearch (#107336) 2024-04-10 16:53:43 -04:00
Benjamin Trent
9e502aa4a0
Expanding and refactoring the vector rolling upgrade tests (#107020)
This commit removes the legacy yaml rolling upgrade tests for vectors to the new rolling upgrade package. 

Also, it adds rolling upgrade tests for `int8_hnsw`.
2024-04-10 10:49:10 -04:00
Mary Gouseti
f66ca2d697
Introduce new node feature for renaming health endpoint (#107154)
The health API was available for experimentation under the
[`_internal/_health`](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/health-api.html)
before it [became
GA](https://www.elastic.co/guide/en/elasticsearch/reference/8.7/health-api.html)
at `8.7.0`. For this reason we introduce another node feature to capture
this change.

Fixes https://github.com/elastic/elasticsearch/issues/106933
2024-04-08 04:26:24 -04:00
Kostas Krikellas
a3a60b592c
[TEST] Add rolling upgrade test for downsampling (#107036)
Simple test, sets up downsampling to run in the old cluster, then waits
for it to complete and verifies that downsampled indexes can get queried
in the mixed and upgraded clusters.
2024-04-03 09:21:41 -04:00
Mark Vieira
d125f52813
AwaitsFix #106933 2024-03-29 18:36:05 -07:00
Mary Gouseti
4352791daa
Add rolling upgrade test for persistent health node task (#106902) 2024-03-29 14:19:11 +02:00
Salvatore Campagna
bdd3a4ffbe
Hash the tsid to overcome dimensions limits (#98023)
A Lucene limitation on doc values for UTF-8 fields does not allow  us to
write keyword fields whose size is larger then 32K. This limits  our
ability to map more than a certain number of dimension fields  for time
series indices. Before introducing this change the tsid is created as a
catenation of dimension field names and values into a keyword field.

To overcome this limitation we hash the tsid. This PR is intended to be
used as a draft to test different options.

Note that, as a side effect, this reduces the size of the tsid field as
a result of storing far less data when the tsid is hashed. Anyway, we
expect tsid hashing to affect compression of doc values and resulting in
larger storage footprint. Effect on query latency needs to be evaluated
too.

Resolves #93564
2024-02-01 08:25:31 -05:00
Lorenzo Dematté
0e328dbfc8
DesiredNode: deprecate node_version field and make it optional (unused) in current parser (#104209)
Deprecated node_version field, made it optional(unused) in new parser
Added deprecation warning handler for mixed cluster
Split tests for old vs. current format
2024-01-29 14:09:45 +01:00
Lorenzo Dematté
f437b7416a
Introduce oldClusterHasFeatures to full-cluster-restart (#104462)
Remove Version-based prerequisites in favour of feature-based prerequisites in ParameterizedFullClusterRestartTestCase and derived.

Follows #104279
2024-01-18 14:24:22 +01:00
Lorenzo Dematté
be2f61a81c
Add checks for old cluster features in rolling upgrade tests (#104279)
Add the ability to test for the original/old cluster features during a rolling upgrade
* Moving ALL_FEATURES to ESRestTestCase (and make it private - only usage)
2024-01-17 14:37:16 +01:00
Mark Vieira
dddc600719
Awaits fix #103473 2024-01-03 15:25:49 -08:00
Rene Groeschke
4a9b4bc982
Make Legacy test cluster infrastructure configuration cache compatible (#101903)
* Move TestCluster plugin and module setup from Node to Cluster
* Do not materialize unused TestCluster
* Fix lazy test cluster evaluation
* Register artifact transforms ones per project
* Make task caching for TestClusterAware tasks CC compatible
* Move stateful logic out of taskgraph.whenready
2023-11-28 12:15:03 +01:00
Lorenzo Dematté
4e81494361
Introducing TestFeatureService to ESRestTestCase (#102243)
* Introducing TestFeatureService to ESRestTestCase

- Added RestTestLegacyFeatures to encompass legacy (historical) features that have been removed from production code but are still needed by REST tests
- Encapsulated Mark's getHistoricalFeatures method inside a FeatureProvider (ESRestTestCaseHistoricalFeatures)
- ESRestTestCaseHistoricalFeatures is not yet used, as we need to figure out how to deal with old cluster tests
2023-11-22 16:35:39 +01:00
Simon Cooper
e851b303d0
Migrate desirednode processors version checks to features (#101706) 2023-11-03 13:57:47 +00:00
Simon Cooper
bfad5e5b13
Create new feature API for querying features present on a cluster (#100974)
This adds an internal API and service to manage & get information on features that are present on nodes in a cluster. New features can be declared as supported, and historical features can be added to previous node versions to eventually replace node version comparisons
2023-10-30 14:38:30 +00:00
Lorenzo Dematté
77dac65761
Fix NodeInfo version parsing in bwc tests (#100838)
* Mixed cluster tests with string NodeInfo version

- Move version based feature comparison to a common, deprecated method (to be replaced with real features)
- Use string comparison against old cluster version to partition new/old cluster nodes
2023-10-25 12:59:10 +02:00
Lorenzo Dematté
f878a8c308
Fix NodeInfo version parsing in integration tests (#100770)
* Compatible version parsing in YAML tests
* Compatible version parsing in various IT tests
2023-10-25 10:55:15 +02:00
Simon Cooper
5f43cd8f46
Retry rolling upgrade junit tests (#99760)
Re-applies the changes from #99572 to move some bwc tests to a junit-based build infrastructure. Some tests that did not handle the move well have been kept in rolling-upgrade-legacy using the old gradle-based infrastructure
2023-09-22 15:52:59 +01:00
Simon Cooper
06f09d861d
Revert "Migrate rolling upgrade tests to new junit format" (#99750)
Reverts elastic/elasticsearch#99572 and #99733

The new tests are unstable, and don't work on CI. This re-opens
https://github.com/elastic/elasticsearch/issues/97200
2023-09-21 09:42:04 -04:00
Simon Cooper
1b8df61bd6
Limit test parallelism to 1 for junit bwc tests (#99733)
gradle runs test tasks in parallel, this results in multiple test clusters being created, which breaks CI.
2023-09-21 11:16:37 +01:00
Simon Cooper
aae2535235
Migrate rolling upgrade tests to new junit format (#99572)
Two test suites did not react well to the junit-based bwc infrastructure, so those have been separated into a legacy module using the old gradle-based system until they can be looked at properly.
This unblocks the 8.11 release.
2023-09-20 16:55:34 +01:00
Martijn van Groningen
0eb2181bb1
Don't ignore empty index template that have no template definition. (#98840)
A composable index template with no template defined in the body is mistakingly always assumed to not be a time series template. Even if it refers to a component template that has the index.mode setting set to time_series and the component template defines mappings with dimension fields or routing paths.

Closes #98834
2023-09-06 07:47:01 +02:00
Simon Cooper
bebe2538b1
Bump to first non-release IndexVersion (#98478)
This bumps to an IndexVersion that is not associated with any specific release version. From this point, index metadata/data versioning will be handled in the same way as TransportVersion - a new constant for every change
2023-08-31 15:10:40 +01:00
Benjamin Trent
4b5585e428
Fix tests after indexing dense vectors by default (#98946)
By default in 8.11, vectors will be indexed by default. However, various
tests that relied on the previous behavior were not updated.

This PR updates those tests.

Related: https://github.com/elastic/elasticsearch/pull/98268
2023-08-29 11:06:02 -04:00
Simon Cooper
b67a9e1ec3
Move text references to index created version to IndexVersion (#98727) 2023-08-23 10:51:56 +01:00