Commit graph

41 commits

Author SHA1 Message Date
Martijn van Groningen
9348d9fcb8
Add feature flag for subobjects auto (#114616) (#114678) 2024-10-13 05:08:41 +11:00
Chris Hegarty
45a08b94b3
Upgrade to Lucene 9.12.0 (#113333) (#113835)
This commit upgrades to Lucene 9.12.0.

Co-authored-by: Adrien Grand <jpountz@gmail.com>
Co-authored-by: Armin Braun <me@obrown.io>
Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
Co-authored-by: John Wagster <john.wagster@elastic.co>
Co-authored-by: Luca Cavanna <javanna@apache.org>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
2024-10-01 13:55:02 +01:00
Mark Vieira
0279c0a909
Add AGPLv3 as a supported license 2024-09-13 14:30:33 -07:00
Simon Cooper
a36d90cf34
Use CLDR locale provider on JDK 23+ (#110222)
JDK 23 removes the COMPAT locale provider, leaving CLDR as the only option. This commit configures Elasticsearch
to use the CLDR provider when on JDK 23, but still use the existing COMPAT provider when on JDK 22 and below.

This causes some differences in locale behaviour; this also adapts various tests to still work whether run on COMPAT or CLDR.
2024-09-04 13:42:40 +01:00
Simon Cooper
ff045118e1
Skip on any instance of node or version features being present (#111268)
Update features skip behavior to skip on any node having the feature, not all nodes
2024-08-07 10:36:59 +01:00
Alexander Spies
2876e059f3
Aggs: Improve scripted metric agg allow list tests (#110153)
* Add an override to the aggs tests to override the allow list default setting. This makes it possible to run the scripted metric aggs tests on Serverless, even when we disallow these aggs per default on Serverless.
* Move the allow list tests next to the scripted metric tests since these belong together.
2024-06-28 11:47:30 +02:00
Benjamin Trent
fdd183ddbd Merge branch 'lucene_snapshot_9_11' 2024-06-12 10:51:02 -04:00
Alexander Spies
e540732e39
Aggs: Scripted metric allow list (#109444)
Introduces new cluster settings that allow only a certain set of scripts in scripted metrics aggregations:
- search.aggs.only_allowed_metric_scripts, defaults to false
- search.aggs.allowed_inline_metric_scripts, defaults to empty list
- search.aggs.allowed_stored_metric_scripts, defaults to empty list
2024-06-12 14:23:03 +02:00
Benjamin Trent
29288d6590 Merge remote-tracking branch 'upstream/main' into lucene_snapshot_9_11 2024-06-11 06:54:23 -04:00
Oleksandr Kolomiiets
1080425a65
Enable fallback synthetic source by default (#109370) 2024-06-07 09:21:22 -07:00
Mayya Sharipova
2337eb05a0
Unified Highlighter to support matched_fields (#107640)
Add support to the Unified highlighter to combine matches on multiple fields
to highlight a single field: "matched_fields".

Based on Lucene PR: https://github.com/apache/lucene/pull/13268

Lucene PR is based on the concept of masked fields where masked fields
are different from the original highlighted field. This PR in
Elasticsearch uses the already existing highlighter parameter
"matched_fields".
2024-05-09 10:35:29 -04:00
Michael Peterson
a451511e3a
Change skip_unavailable default value to true (#105792)
In order to improve the experience of cross-cluster search, we are changing
the default value of the remote cluster `skip_unavailable` setting from `false` to `true`.

This setting causes any cross-cluster _search (or _async_search) to entirely fail when
any remote cluster with `skip_unavailable=false` is either unavailable (connection to it fails)
or if the search on it fails on all shards.

Setting `skip_unavailable=true` allows partial results from other clusters to be
returned. In that case, the search response cluster metadata will show a `skipped`
status, so the user can see that no data came in from that cluster. Kibana also
now leverages this metadata in the cross-cluster search responses to allow users
to see how many clusters returned data and drill down into which clusters did not
(including failure messages).

Currently, the user/admin has to specifically set the value to `true` in the configs, like so:

```
cluster:
    remote:
        remote1:
            seeds: 10.10.10.10:9300
            skip_unavailable: true
```

even though that is probably what search admins want in the vast majority of cases.

Setting `skip_unavailable=false` should be a conscious (and probably rare) choice
by an Elasticsearch admin that a particular cluster's results are so essential to a
search (or visualization in dashboard or Discover panel) that no results at all should
be shown if it cannot return any results.
2024-04-29 15:53:47 -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
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
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
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
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
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
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
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
Tim Vernum
50706f0f5e
Support path filtering in YAML test suite (#98430)
Some Rest Specs contain multiple paths, where some paths are
preferred and the others exist for historical reasons.

This commit makes 2 changes:

1. Tracks when a path is deprecated in the Rest Spec, so that metadata
   can be accessed in the Java model of the API
2. Adds filter (predicate) to the execution context to determine which
   paths should be considered as candidates within the test suite

Tests that extends from `ESClientYamlSuiteTestCase` can override
`createRestTestExecutionContext` and pass in a predicate that skips
deprecated paths (or any other criteria), provided that it does not
skip _all_ paths in an API.
2023-08-15 13:03:16 +10:00
Yang Wang
d0f64941f0
Remove RCS 2.0 feature flag for beta release (#98307)
This PR removes the RCS 2.0 feature flag so that it is ready for beta
release.
2023-08-14 08:33:37 +10:00
Tim Vernum
6fa5c61cf2
Support operator users in LocalClusterSpec (#97340)
This adds a new parameter to LocalClusterSpecBuilder.user(..) to
indicate whether the user should be an operator or not.

Users added with the simplified user(username, password) method are
operators (and have the "_es_test_root" role).
2023-08-09 02:38:58 -04:00
Rene Groeschke
89a65b2c5a
Make ESRestTestCase client configuration more configurable in subclasses (#96987)
We want to be able to tweak client configuration in tests extending
ESRestTestCase. This makes that simpler by allowing overriding the
general client configuration.
2023-06-21 14:02:34 -04:00
Yang Wang
86f37160ae
Enforce API key type on authentication (#95908)
The PR adds enforcement for API key type at authentication time.
Concretely, new cross-cluster API keys (#95714) can only be used on the
dedicated remote cluster interface and the existing (rest) API key must
not be used for new remote cluster communication. To make cross-cluster
API keys actually usable after authentication, the PR also adds support
for resolving their roles.
2023-05-10 00:12:07 -04:00
Yang Wang
ac9822be72
Add named privileges for CCR with new RCS model (#95651)
This PR adds new named cluster and index priviliges for CCR actions
required with the new RCS model. The new privileges are tightly scoped
so that it is no longer necessary to grant wider named privileges, e.g.
manage. Concretely, the following privileges are added: * cluster
privilege `cross_cluster_replication` * index privilege
`cross_cluster_replication` covers index actions required to be
performed with end users * index privilege
`cross_cluster_replication_internal` covers index actions performed by
the internal user

The intention of having two index privileges for CCR is that
`cross_cluster_replication` could be granted as part of `remote_indices`
for end-users on the QC (follower cluster). QC admins or users do not
have to care about `cross_cluster_replication_internal` which will be
automatically handled by FC (leader cluster) admins once the specialized
API key is in place.

The PR also renames `cross_cluster_access` to `cross_cluster_search`
which corresponds better to the new `cross_cluster_replication`.
2023-05-04 01:05:08 -04:00
Yang Wang
5dc2541675
Use SecureSetting to store RCS remote access key (#93763)
The remote access key is a secret. As such it should be stored in the ES
keystore instead of a filtered setting in cluster state.
2023-03-22 22:08:44 -04:00
Nikolaj Volgushev
56b849d802
Rename remote cluster setting to credentials (#94560)
Renames the `cluster.remote.*.authorization` setting to
`cluster.remote.*.credentials` since the name is more precise and aligns
with the rest of the code base.
2023-03-22 05:16:30 -04:00
Yang Wang
e126dc7063
Add redacted cluster credentials to RemoteConnectionInfo response (#94527)
This PR adds a redacted cluster_credentials field to the
RemoteConnctionInfo API response to differenitate between basic and RCS
remote clusters. The new field is available only for RCS remote
clusters.
2023-03-20 21:58:42 -04:00
Nikolaj Volgushev
90f6af3bdc
Naming refactor to use cross cluster access consistently (#94424)
Rename refactor PR that uses `cross_cluster_access` in place of
`remote_access` wherever appropriate, since `cross_cluster_access` is a
more precise, clearer term. No functional changes, however I did make a
few tweaks around version handling.
2023-03-14 13:13:09 -04:00
Yang Wang
43a4e8859a
[Test] Increase timeout for RcsCcsCommonYamlTestSuiteIT (#94493)
The test suite has been recently expanded to including more YAML tests,
PIT and msearh (#93720), EQL (#94265) and SQL (#94416). The original 15
min timeout needs to be bumped a bit to accomodate the new tests. This
PR increases it for additional 5 minutes.

PS: It is possible that the corresponding CcsCommonYamlTestSuite also
needs to similar increase in timeout. This PR does not touch it because
we haven't observed similar timeout for it so far and also tests with
existing CCS model and security disabled run a bit faster. So it may not
be an issue yet.

Resolves: #94491
2023-03-13 15:10:30 -04:00
Yang Wang
4f196c23cd
[Test] Add SQL yaml tests to CCS common yaml test suite (#94416)
This PR adds support for CCS common YAML test suite to run SQL yaml
tests with both the existing and new remote cluster models.

Relates: #94265, #93720

PS: SQL does not send its own actions across clusters and relies only on
the generic search, field_caps actions. Hence it is automatically
supported without touching production code, i.e. changes are test only.
2023-03-11 06:54:57 -05:00
Yang Wang
a96ffea12e
Ensure EQL works with RCS (#94265)
The PR allows EQL read action to work with new RCS. It also updates the
common CCS test suite to include existing EQL yaml tests.

Relates: https://github.com/elastic/elasticsearch/pull/93720
2023-03-08 16:51:13 -05:00
Yang Wang
e48728571d
Add named privilege for RCS cross cluster access (#94384)
This PR adds a new named privilege to encapsulate system actions
required for cross cluster access.
2023-03-09 00:17:16 +11:00
William Brafford
8b6ce3465e
Reset feature states before deleting indices in EsRestTestCase (#94191)
* Call feature cleanup in ES Test Case
* Don't reset features in certain integration tests
* Cleanup and handle warnings
2023-03-07 10:53:48 -05:00
Yang Wang
9d6c44311d
Support Sniff mode for RCS (#93893)
This PR adds sniff mode support for RCS. It's achieved by having
alternative handshake action and nodes action to return DiscoveryNode
with remote cluster server address instead of the main transport
address. The changes are only effective to the new model and how
existing remote cluster model works is fully maintained. REST tests are
updated to random between proxy and sniff mode.

An additional benefit of using the alternative handshake action is that
we can remove the special handling of handshake action on the FC side to
ensure all actions must be allowed by the remote access API key. This
will be addressed in a separate PR.
2023-02-28 04:32:08 -05:00
Yang Wang
26d01b71bd
Ensure search features work with the new RCS model (#93720)
This PR ensures most search features (scroll, async search, pit, field
caps, msearch, vector tile etc) work with the new RCS model. The main
code change is tested by adapting the common yaml CCS tests to use the
new RCS model to provide a broad test coverage. The tests ensure the new
RCS model works from search's perspective. We could still use more tests
from security's perspective, e.g. DLS/FLS, in separate PRs.

Note:  * Eql yaml test files are not located under `x-pack/plugin` and
this makes it hard to reuse. It should be possible to relocate them. But
I'll address it separately.  * Sql yaml requires special transformation
to work. I'll also have it separately.
2023-02-15 21:10:56 -05:00
Mark Vieira
13181ea2e6
Convert ccs-common-rest QA project to new test clusters framework (#92516) 2022-12-22 08:51:11 -08:00
Julie Tibshirani
3a9e511117
Move kNN search and dense vectors to core (#87815)
This PR moves kNN search and dense vector support out of an xpack plugin and
into server.

In #87625 we plan to integrate ANN search into the main `_search` endpoint as a
new top-level component called `knn`. So kNN will be a dedicated part of the
search request, and we'll have kNN logic within the search phases. The classes
and logic will live in server, matching the other search components like
suggesters, field collapsing, etc.
2022-06-22 21:10:20 -07:00
Christoph Büscher
410d38162d
Run yaml rest tests using CCS in multi-cluster setup (#86521)
Currently we only test a small subset of cross cluster search functionality in
rest tests living in the 'multi-cluster-search' qa module. In order to increase
test coverage for basic CCS functionality , this change adds a new qa modula
that re-uses a subset of existing yaml rest tests and runs them in a slightly
modified fashion in a CCS scenario.
Document data and other write operations are executed agains a "remote"
cluster, while all calls to the search API aand other APIs that support CCS are
performed on a local cluster connected to the remote with all the data via CCS.

Relates to #84481
2022-05-24 16:42:49 +02:00