Commit graph

2193 commits

Author SHA1 Message Date
Ignacio Vera
c62df16c38
Fix Bucket ordering for partial reduction in date histogram and histogram aggregation (#108184)
#105359. we changed the bucket ordering for partial reduces which causes issues when the output is shared with a 
node running on an older version. This commit reorders the output to the expected order for previous versions.
2024-05-03 14:31:54 +02: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
Lee Hinman
d297d79927
Fix require_alias implicit true value on presence (#104099)
* Fix `require_alias` implicit true value on presence

This commit brings the `require_alias` query-string parameter into line with the rest of our parameters where its presence indicates an implicit "true" value (so a user can do `POST /_bulk?require_alias` to enable the check).

Resolves #103945

* Update docs/changelog/104099.yaml
2024-01-09 10:08:41 -07:00
Mary Gouseti
046cdeae23
Introduce lazy rollover for mapping updates in data streams (#103309)
In this PR we implement the idea to introduce a flag, that a data stream needs to be rolloved over before the next document is indexed.
2024-01-08 15:07:16 +02:00
Armin Braun
36f08ea441
Make use of constants and utility methods to build empty SearchHits instances (#103983)
This are to be made ref-counted shortly. There's no point in having any
pooling/leak-tracking for empty instances though. To prepare for that,
lets add some short-cuts for dealing with empty instances to make the
overall change smaller and cleanup code already.
2024-01-05 17:43:06 +01:00
Mark Vieira
c6752e18f4
Fix failing test in release mode (#103883) 2024-01-03 15:27:32 -08:00
Mark Vieira
dddc600719
Awaits fix #103473 2024-01-03 15:25:49 -08:00
Lorenzo Dematté
cea88cbeec
Replace Version with String in YAML framework, pushing Version parsing where is actually needed (#103311)
* Pushing down node versions as strings

Deferring Version parsing to the actual places where a minimum node version/common cluster version is needed; eventually this will be completely lazy and/or replaced by other checks (e.g. features).
Combine versions, oses and features in multi-cluster YAML test contexts.
2024-01-03 09:29:40 +01:00
James Baiera
db093cda76
Test Fix: Add failure store feature flag to ccs rolling upgrade tests (#103484) 2024-01-02 09:37:11 -07:00
David Turner
60b833bb6d
Add utils for general XContent REST requests (#103711)
Tests that send REST requests with bodies must today build up a separate
`String` containing the body contents as JSON. This is kinda ugly, and
also means we do not cover the other supported body formats in these
tests. This commit introduces a utility to allow construction of REST
requests with `XContent` bodies directly, and generalizes things to
choose randomly between JSON and other supported body formats.
2024-01-02 13:39:21 +00:00
Armin Braun
7fc1fcb2ee
Remove InternalSearchResponse as well as most usage of SearchResponseSections (#103583)
This indirection isn't really necessary now that its use in the high
level rest client went away. -> flattened the `SearchResponse` class to
make ref counting easier -> removed `InternalSearchResponse` whose
functionality was completely redundant now -> removed serialization and
most of the usage of `SearchResponseSections`, only keeping this for the
few search execution spots that currently use it and where removing it
won't get us anything and will be a huge changeset.

enables the last steps in #102030
2023-12-20 12:57:36 -05:00
Lorenzo Dematté
1900a99018
Refactor: move version, os, features from ClientYamlTestClient to ClientYamlTestExecutionContext (#103560)
Just moving stuff around, no change in behaviour. Moving these fields showed how we are not treating correctly in derived classes where multiple clusters are tested (ex: CCR), but this is for another time.

Co-authored-by: Moritz Mack <moritz@mackmail.net>
2023-12-20 10:05:19 +01:00
Joe Gallo
293aaa0209
Externalize TemplateScript.Factory rendering from IngestDocument (#103363) 2023-12-14 20:01:11 -05:00
James Baiera
f4d791f8b4
Add failure store feature flag to bwc testing (#103341)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2023-12-12 15:01:11 -05:00
Lorenzo Dematté
93bd1abf2a
Addressing more Version usages in tests (#102803) 2023-12-12 16:44:24 +01:00
Lorenzo Dematté
efeec01f3b
Passing down cluster features to YAML test framework (#102921)
- Cluster features passed down as a predicate via context
- Removing the not-needed (unused) master node version
2023-12-11 18:34:44 +01:00
David Turner
2e592a3416
More logging for ClusterHealthRestCancellationIT (#103193)
Relates #100062
2023-12-08 08:48:52 -05:00
Armin Braun
e20821f13e
Remove some more ActionType subclasses (#103055)
Cleaned up a few more of these.
2023-12-07 22:05:45 +01:00
Lorenzo Dematté
bbe9f115cc
More version removal/mitigation (#102867) 2023-12-05 10:18:49 +01:00
Benjamin Trent
caec612fea
Make cosine similarity faster by storing magnitude and normalizing vectors (#99445)
`cosine` is our default similarity and should provide a good experience
on speed.

`dot_product` is faster than `cosine` as it doesn't require calculating
vector magnitudes in the similarity comparison loop. Instead, it can
assume vectors have a length of `1` and use an optimized `dot_product`
calculation.

However, `cosine` as it exists today accepts vectors of any magnitude
and cannot take advantage of this.

This commit addresses this by:

 - Normalizing all vectors passed when indexing via `cosine`
 - Storing the calculated magnitude in an additional field (only if its `!= 1`).
 - Using the `dot_product` Lucene calculation
 - Normalizing query vectors when used against these new `cosine` fields
 - De-normalizing vectors when accessed via scripts
 - Allowing scripts to access these stored magnitudes.
2023-12-01 13:45:43 -05:00
William Brafford
0a4a052abc
Bring packaging tests README up to date (#102675) 2023-11-28 08:36:56 -05: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
Armin Braun
c45b95d0eb
Remove some more ActionType subclasses (#102354)
Removing a couple more of these from the search package.

Co-authored-by: Joe Gallo <joegallo@gmail.com>
2023-11-27 19:11:19 +01:00
Luca Cavanna
f7f03669a1
Mute failing pit with index filter ccs yaml tests (#102666)
search/350_point_in_time/point-in-time with index filter is failing
often, hence this commit mutes it.

Relates to #102596
2023-11-27 11:51:55 -05:00
David Turner
8914314c1b
Record chunked response size before sending last chunk (#102586)
We expect that the HTTP response stats should reflect the responses
received by the client, but today we record that a chunked-encoded
response was sent _after_ sending the last chunk, which might mean that
the client can receive the complete response body and then retrieve
stats that do not include that response. With this commit we record the
stats before sending the last chunk.

Closes #102547
2023-11-27 05:36:20 -08:00
Yang Wang
e649a08a1b [Test mute] AwaitsFix #102547 2023-11-24 21:57:33 +11:00
Armin Braun
cdc83ad29b
Add shorthand for prepareIndex to test infrastructure (#101187)
Same as #101175, shorten `client().prepareIndex(index)` and
`client().prepareIndex().setIndex(index)` via a test utility.
Saves lots of code now and sets up some follow-up simplifcations.
2023-11-23 15:47:36 +01:00
Lorenzo Dematté
4c1cd18073
REST tests: converting more version-based checks to test-only features (#102483) 2023-11-23 12:29:19 +01:00
Simon Cooper
dd82613a81
Remove various obsolete version references in tests (#102481)
Add some more UpdateForV9 annotations
2023-11-23 09:55:15 +00: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
Jake Landis
17a46a6e9f
upgrade bouncy castle jars (#100923)
This commit upgrades the Bouncy Castle jars. Bouncy Castle is used for 
some internal build concners as well as a comnand line application. 
Most notably Bouncy Castle is also used as the FIPs certified JCE/JSEE provider 
we use to test our ability to use a FIPs compliant crypto provider. 

The following changes here are a result of the upgraded Bouncy Castle jars:
* TLSv1.3 is now supported when running in FIPs mode 
* RSA PKCS#1 v1.5 is no longer allowed in FIPS mode
* Triple DES (3DES) is no longer allowed in FIPS mode
* Minor updates the security manager configuration used to test FIPs (to read permissions from the security provider)
* Minor adjustments to tests to accommodate the above changes. 
* Minor adjustments to the gradle build to accommodate new dependencies 

Note - update to the documentation will come in a later commit.
2023-11-21 11:14:41 -06:00
Luca Cavanna
9cd96df179
Add support for index_filter to open pit (#102388)
The open point in time API accepts a list of indices and opens a point in time view against those indices.
Like we do already for field caps, this commit allows users to provide an index_filter parameter as part of
the request body, that will be used to execute the can match phase and exclude the indices that can't possibly
match such filter.

Closes #99740
2023-11-21 15:35:49 +01:00
Ignacio Vera
f6da877605
Fix mistake when removing the High level rest Client in CCSDuelIT (#102330) 2023-11-17 11:17:03 +01:00
Ievgen Degtiarenko
4474bbd153
Expose reconciliation metrics via APM (#102244) 2023-11-16 17:58:50 +01:00
Ignacio Vera
c579ab2d4a
Remove HighLevelRestClient from CCSDuelIT (#102222) 2023-11-16 12:18:03 +01:00