Commit graph

2226 commits

Author SHA1 Message Date
Rene Groeschke
98bfeab21c
Remove cross project support in TestFixturesPlugin (#109077) (#109081)
- One step closer to configuration cache support
- Crossproject support has been replaced by using testcontainer based fixtures
2024-06-21 23:14:12 +10:00
Mark Vieira
c6798306c9
Adjust packaging test exit code assertion (#109879) (#109891)
# Conflicts:
#	muted-tests.yml
2024-06-19 08:02:07 +10:00
Martijn van Groningen
d96660fbbd
Fix testMapperDynamicIndexSetting() failures (#109574) (#109604)
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:47:29 +10:00
Martijn van Groningen
a20fa1713d
Re-define index.mapper.dynamic setting in 8.x (#109341) (#109564)
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 19:11:13 +10:00
Mark Vieira
5616d0c41e
Increase startup timeout in packaging tests (#108487) (#108489) 2024-05-09 20:13:02 -04:00
Mark Vieira
3458f211d6
Refactor rolling upgrade tests to make it easier to customize (#108393) (#108419)
# Conflicts:
#	qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/IgnoredMetaFieldRollingUpgradeIT.java
2024-05-08 12:15:42 -04:00
Ignacio Vera
8159673ee4
Strength ccs testing of aggregations in mixed clusters setup (#108235) (#108249) 2024-05-03 09:19:34 -04:00
Simon Cooper
aeb8bc1b1c
Update several references to IndexVersion.toString to use toReleaseVersion (#107828) (#107889) 2024-04-26 16:45:36 +01:00
Kostas Krikellas
d11048e7ff
Mute DocketTests.test150MachineDependentHeap (#107509)
Related to #104786
2024-04-16 04:34:18 -04:00
Jonathan Buttner
d8348560a9
muting (#107496)
Muting https://github.com/elastic/elasticsearch/issues/100062
2024-04-15 17:17:34 -04: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
Ievgen Degtiarenko
32bcb13ac4
Introduce an easy way to get node id by its name (#107392)
Our test utility returns the node name when starting a new node.
A lot of APIs (such as routing table or node shutdown) require a node id.
This change introduces a simple way to retrieve the node id based on its name.
2024-04-12 10:50:11 +02: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
Tim Vernum
36d5282907
Allow additional JSON log fields via SPI (#106980)
This adds a new SPI based `LoggingDataProvider` service that can be
implemented in order to add new fields to the main JSON log
2024-04-10 22:14:00 -04: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
755226df23
[TEST] Add full cluster restart test for downsampling (#107053)
This is a copy of the test added for rolling upgrade in #107036
2024-04-03 11:09:17 -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
Benjamin Trent
89bf4b33e8
Make int8_hnsw our default index for new dense-vector fields (#106836)
For float32, there is no compelling reason to use all the memory
required by default for HNSW. Using `int8_hnsw` provides a much saner
default when it comes to cost vs relevancy. 

So, on all new indices that use `dense_vector` and want to index them
for fast search, we will default to `int8_hnsw`. 

Users can still customize their parameters, or prefer `hnsw` over
float32 if they so desire.
2024-04-01 08:23:32 -04:00
Armin Braun
60d5083b5f
Remove some more ActionType subclasses (#106947)
Cleaning up a couple more of these from the server module.
2024-03-31 21:49:30 +02: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
Moritz Mack
f0b61f864f
Enable data-streams module in REST tests (#106875) 2024-03-28 17:31:50 +01:00
David Turner
9a907704b7
Move XContent -> SnapshotInfo parsing out of prod (#106669)
The code to parse a `SnapshotInfo` object out of an `XContent` response
body is only used in tests, so this commit moves it out of the
production codebase and into the test framework.
2024-03-22 09:46:46 -04:00
Ryan Ernst
acb16ff36b
Improve packaging test debugging (#106491)
Packaging tests have several files that may be useful in debugging
failures. Additionally, we sometimes have assertions for which we want
to catch them and emit additional debugging info. This commit guards
the common ways that Elasticsearch is started and assertions are run
with dumping all debug information available.
2024-03-19 11:14:18 -07:00
Moritz Mack
5a7b53a277
Fix leakage of log-level in LoggersTests (#106260)
(fixes #106250)
2024-03-14 15:26:33 +01:00
David Turner
12e567d29e
Consolidate get-snapshots ?after logic (#106038)
Today the handling of the `?after` param is kinda spread out over
`TransportGetSnapshotsAction` and `GetSnapshotsRequest` making it hard
to follow and adding unnecessary complexity to these two classes. This
commit moves it into `SnapshotSortKey` which is a better fit since the
behaviour varies so much for different sort keys.
2024-03-12 05:16:46 -04:00
Niels Bauman
e58dc5228d
Increase master transition threshold in health API YAML REST tests (#106013)
Due to the nature of the `mixed-cluster` tests setup,
we sometimes see a couple of master changes in a short amount of time.
2024-03-06 22:06:30 +01:00
David Turner
1fae3e7501
Extract SnapshotSortKey (#106015)
The behaviour of the get-snapshots API varies quite considerably
depending on the sort key chosen. Today this logic is implemented using
scattered `switch` statements and other conditionals but it'd be clearer
if we delegated this stuff to the sort key instances themselves. This
commit moves the sort key enum to the top level and replaces one of the
`switch` statements with a method on the enum instances.
2024-03-06 15:27:57 +00:00
Athena Brown
92c2b36e69
Decouple enrollment token version from node version (#104018)
This commit decouples the version used in enrollment tokens from node
version, as part of the larger effort to make versioning more granular.
The changes are relatively minimal, as the version encoded into
enrollment tokens is not actually used anywhere as far as I can tell,
either in Elasticsearch or Kibana, apart from checks that it is present.
That said, I've been around the block enough times to know better than
to remove a perfectly good version field that's already in something
like this.
2024-02-22 19:31:03 -05:00
Simon Cooper
b752169ee9
Use hamcrest regex matcher rather than our own (#104457)
The difference is that our matcher uses .find() to search for a regex match anywhere in the string, whereas the hamcrest one uses .matches() to check the whole string against the regex. This leads to more specific regex checks.

I've left our own one for YAML tests, as that way we don't need to mangle the regex to add .* either side, which might be confusing in test failures.
2024-02-22 16:15:36 +00:00
Moritz Mack
6b50b6ddf9
Block updates to log level for restricted loggers if less specific than INFO (#105020)
To prevent leaking sensitive information such as credentials and keys in logs, this 
commit prevents configuring some restricted loggers (currently `org.apache.http` 
and `com.amazonaws.request`) at high verbosity unless the NetworkTraceFlag 
(`es.insecure_network_trace_enabled`) is enabled.
2024-02-21 17:45:51 +01:00
David Turner
7cbdb6cc19
Drop dead code from get-snapshots request & response (#105608)
Removes all the now-dead code related to reading pre-7.16 get-snapshots
requests and responses, and also moves the `XContent` response parsing
out of production and into the only test suite that uses it.
2024-02-21 07:57:50 +00:00
Armin Braun
5c8006499a
Move test-only search response x-content-parsing code to test codebase (#105308)
Loads of code here that is only used in tests and one duplicate unused
class that was only used as an indirection to parsing the
`AsyncSearchResponse`. Moved what I could easily move via automated
refactoring to `SearchResponseUtils` in tests and removed the duplicate
now unused class from the client codebase.
2024-02-09 11:56:39 +01:00
Matteo Piergiovanni
54cfce4379
Flag in _field_caps to return only fields with values in index (#103651)
We are adding a query parameter to the field_caps api in order to filter out 
fields with no values. The parameter is called `include_empty_fields`  and 
defaults to true, and if set to false it will filter out from the field_caps 
response all the fields that has no value in the index.
We keep track of FieldInfos during refresh in order to know which field has 
value in an index. We added also a system property 
`es.field_caps_empty_fields_filter` in order to disable this feature if needed.

---------

Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>
2024-02-08 17:52:21 +01:00
Ryan Ernst
b67f5a6b57
Make cluster feature predicate available to plugins (#105022)
A predicate to check whether the cluster supports a feature is available
to rest handlers defined in server. This commit adds that predicate to
plugins defining rest handlers as well.
2024-02-01 09:11:18 -08: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é
7764fdb3ea
Exclude tests that do not work in a mixed cluster scenario (#104935) 2024-01-31 09:32:21 +01:00
Moritz Mack
dbf59c5414
Update/Cleanup references to old tracing.apm.* legacy settings in favor of the telemetry.* settings (#104917) 2024-01-31 09:20:05 +01:00
Joe Gallo
f2e7b64c18
Remove gradle references to the rest-high-level client (#104871) 2024-01-29 14:13:06 -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
Tim Vernum
f3bc319b13
Convert RestWrapper to an explicit Interceptor (#104291)
Adds a new `RestInterceptor` interface and converts
`RestServerActionPlugin.getRestHandlerInterceptor` to return this new
type instead of a wrapping function.

This has the following benefits:
- Less object creation, there is 1 instance of the interceptor class
  (see `SecurityRestFilter`) rather than an instance per handler
- More control over the sequence of steps in processing a request.
  The explicit interceptor separates it from the deprecation handler
  or any validation that might be needed, and the controller can be
  intentional about the order in which these operations are applied.
2024-01-18 17:08:06 -08: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
Armin Braun
51caf171bc
Remove redudant children of BroadcastResponse (#104410)
A couple of children of `BroadCastResponse` are completely redundant,
adding no extra fields or separate serialization.
Removed them and replaced their use by the broadcast response itself.
2024-01-16 16:56:29 +01:00
Joe Gallo
af50962ec3
Fix CoreFullClusterRestartIT testRollover (#104373) 2024-01-16 10:54:17 -05:00
Luca Cavanna
4717f9c5c1
Don't throw error for remote shards that open PIT filtered out (#104288)
We recently introduced support for index_filter to the open point in time API (see #102388).
Open point in time supports executing against remote indices, in which case it will open a
reader context against the target remote shards. With support for index_filter, shards that
cannot match the filter are not even included in the PIT id that open PIT returns.

When the following search is executed that includes such PIT id, there is one search shards call
per cluster performed, which will return all shards from the targeted indices, including those
that open PIT has filtered out. In that case, we should just ignore those shards instead of
throwing exception when those are looked up in the search context id map built from the PIT id.

Closes #102596
2024-01-15 15:36:33 +01:00
Lorenzo Dematté
2b175653d9
YAML test framework: separate skip and requires sections (#104140)
* Introduce Prerequisites criteria (Predicate + factory) for modular skip decisions
- Removed accessors to specific criteria from SkipSection (used only on tests), adjusted test assertions
- Moved Features check (YAML test runner features) to SkipSection build time

* Separated check for xpack/no_xpack
Check for xpack is cluster-configuration (modules installed) dependent, while Features are meant to be "static" test-runner capabilities. We separate them so checks on one (test-runner features) can be run before and separately from the other.

* Consolidate skip() methods
- Divide require and skip predicates
- Divide requires and skip parsing (distinct sections)
- Renaming SkipSection to PrerequisiteSection and related methods/fields (e.g. skip -> evaluate)

* Refactoring tests
- moving and adding VersionRange tests
- adding specific version and os skip tests
- modified parse/validate/build to make SkipSection more unit-testable

* Adding cluster feature-based skip criteria
* Updated javadoc + renaming + better skip reason message
2024-01-15 14:48:36 +01:00
Simon Cooper
016c778321
Remove NamedWriteableRegistry from NodeClient, pass it directly through to rest actions (#103277) 2024-01-11 12:42:22 +00:00