Commit graph

1426 commits

Author SHA1 Message Date
Rene Groeschke
aefa784360
Cleanup SamlAuthenticationIT (#106227) (#106287)
Remove comments about awaitsFix
2024-03-13 09:32:55 -04:00
Rene Groeschke
63e4917775
Add Saml test connection timeout debugging output (#104801) (#106226)
Add additional logging to idp test fixture container

(cherry picked from commit 46beceb180)
2024-03-13 13:07:11 +01:00
Iraklis Psaroudakis
6c3a9d10e3
Mute 3 SamlAuthenticationIT tests (#105488)
testLoginUserWithAuthorizingRealm testLoginUserWithSamlRoleMapping
testLoginWithWrongRealmFails

Relates #103595
2024-02-14 05:27:25 -05:00
Dmitry Cherniachenko
e21a4874ab
Use String.replace() instead of replaceAll() for non-regexp replacements (#105127)
* Use String.replace() instead of replaceAll() for non-regexp replacements

When arguments do not make use of regexp features replace() is a more efficient option, especially the char-variant.
2024-02-12 13:11:15 -05:00
Slobodan Adamović
0dc78a32af
Execute SAML authentication on the generic threadpool (#105232)
This PR changes SAML transport actions to use `GENERIC` executor 
in order to avoid executing potentially slow and blocking IO/HTTP 
operations on the `transport_worker` threads.

Fixes #104962
2024-02-09 18:00:09 +01: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
Simon Cooper
0409e39582
Mute testCannotFollowLeaderInUpgradedCluster (#105332) 2024-02-09 09:55:48 +00:00
Michael Peterson
ac36aa7795
Resolve Cluster API (#102726)
To improve cross-cluster search user experience, Kibana needs an endpoint that is accessible
by arbitrary Kibana dashboard search users and provides:

1. a listing of clusters in scope for a CCS query (based on the index expression and whether 
there are any indices on each cluster that the Kibana user has access to query).
2. whether that cluster is currently connected to the querying cluster (will it come back as 
skipped or failed in a CCS search)
3. showing the skip_unavailable setting for those clusters (so you can know whether it will
return skipped or failed in a CCS search)
4. the ES version of the cluster

Since no single Elasticsearch endpoint provides all of these features, this PR creates a new endpoint `_resolve/cluster` that works along side the existing `_resolve/index` endpoint 
(and leverages some of its features).

Example usage against a cluster with 2 remote clusters configured:

GET /_resolve/cluster/*,remote*:bl*

Response:

{
  "(local)": {
    "connected": true,
    "skip_unavailable": false,
    "matching_indices": true,
    "version": {
      "number": "8.12.0-SNAPSHOT",
      "build_flavor": "default",
      "minimum_wire_compatibility_version": "7.17.0",
      "minimum_index_compatibility_version": "7.0.0"
    }
  },
  "remote2": {
    "connected": true,
    "skip_unavailable": true,
    "matching_indices": true,
    "version": {
      "number": "8.12.0-SNAPSHOT",
      "build_flavor": "default",
      "minimum_wire_compatibility_version": "7.17.0",
      "minimum_index_compatibility_version": "7.0.0"
    }
  },
  "remote1": {
    "connected": true,
    "skip_unavailable": false,
    "matching_indices": false,
    "version": {
      "number": "8.12.0-SNAPSHOT",
      "build_flavor": "default",
      "minimum_wire_compatibility_version": "7.17.0",
      "minimum_index_compatibility_version": "7.0.0"
    }
  }
}

Almost all errors show up as "error" entries in the response.
Only the local SecurityException returns a 403 since that happens before the ResolveCluster
Transport code kicks in.
2024-02-08 10:50:05 -05:00
Costin Leau
fca3fc82be
ESQL: Grammar - FROM METADATA no longer require [] (#105221)
Remove usage of [ ] through-out the grammar, in this case inside
 FROM METADATA.
2024-02-08 07:03:19 -08:00
Simon Cooper
31c66c1a8c
Add a few examples of using version mapping in error messages (#104751) 2024-02-06 10:30:59 +00:00
Nhat Nguyen
a5a4b9e529
Add security tests for cross clusters query (#104879) 2024-02-01 13:15:22 -08: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
Joe Gallo
f2e7b64c18
Remove gradle references to the rest-high-level client (#104871) 2024-01-29 14:13:06 -05:00
Iraklis Psaroudakis
4f4e6133e1
Revert "Mute testCannotFollowLeaderInUpgradedCluster (#104678)" (#104748)
This reverts commit 0e689da408.
2024-01-29 11:00:59 +02:00
Rene Groeschke
ab8ee60bba
Fix SamlAuthenticationIT flakyness (#103867) 2024-01-24 13:44:31 -05:00
Iraklis Psaroudakis
0e689da408
Mute testCannotFollowLeaderInUpgradedCluster (#104678)
Relates #104620
2024-01-24 05:35:29 -05:00
eyalkoren
6f4e293d29
Add require_data_stream feature (#101872)
Closes #97032

Adding the ability to set `require_data_stream` parameter (boolean) on bulk and indexing APIs.
For document indexing, this flag requires the indexing operation to either be pointed at a data stream, or match a template that will create a data stream.
2024-01-18 09:15:48 -07: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é
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
Nik Everett
3da01e0a16
ESQL: Fix old version tests (#104333)
This weakens an assertion in the ESQL tests rolling upgrade tests so
they'll pass against older versions of Elasticsearch. Apparently the
warning message changed. There isn't a good reason to be so strict about
the assertion anyway.

Closes #104101
2024-01-12 15:37:52 -05:00
Simon Cooper
016c778321
Remove NamedWriteableRegistry from NodeClient, pass it directly through to rest actions (#103277) 2024-01-11 12:42:22 +00:00
David Roberts
af336e7495
[ML] Unmute MLModelDeploymentsUpgradeIT testTrainedModelDeployment (#104222)
It seems that this test failure was purely down to inconsistency of ml-cpp
dependencies, and not a real problem. Therefore the test can be unmuted.

Fixes #104193
2024-01-11 09:34:35 +00:00
Albert Zaharovits
f4aaa20f28
Add support for the type parameter to the Query API Key API (#103695)
This adds support for the type parameter to the Query API key API.
The type for an API Key can currently be either rest or cross_cluster.

Relates: #101691
2024-01-11 10:53:50 +02:00
David Turner
f24c675778 AwaitsFix for #104193 2024-01-10 11:00:03 +00:00
Mark Vieira
7c48efcd47
Reduce concurrency of execution for x-pack full cluster restart tests (#104166) 2024-01-09 14:29:32 -08:00
Mark Vieira
c19650066c
Mute FullClusterRestartIT.testDisableFieldNameField 2024-01-09 13:13:18 -08:00
David Roberts
0b6b67d77e
Enable failure_store feature for X-Pack full cluster restart tests (#104098)
This test suite indirectly uses functionality that requires the
failure_store functionality.

Closes #104078
2024-01-08 16:14:10 -05:00
Nik Everett
a675f7d4ed ESQL: Remove replica from test
This removes a replica from a "full cluster updrade" test for esql.
There are rare errors that look to be caused by this test and I think
this might have something to do with it. Either way, it doesn't hurt
anything.
2024-01-05 15:05:17 -05:00
Nik Everett
a994aede95
ESQL: Check field exists before load from _source (#103632)
Loading fields from `_source` is *super* slow because you have to
decompress the stored fields and then turn the stored field into a
map-of-maps. And then dig through the map-of-maps. This adds "does this
field exist" style checks before most loads from `_source`. Not all
fields can do it, but most fields can.

This really improves the performance of our
`esql_dissect_duration_and_stats` benchmark, mostly because it is
running `dissect` on a field that has to load from `_source` that isn't
in many of the documents. Here's the performance:
```
|  50th percentile service time | 867.667 | 100.491 | -767.176 | ms | -88.42% |
|  90th percentile service time | 886.042 | 102.434 | -783.608 | ms | -88.44% |
| 100th percentile service time | 893.035 | 104.598 | -788.437 | ms | -88.29% |
```
2024-01-05 08:51:15 -05:00
David Turner
593be83359 AwaitsFix for #103808 2024-01-02 16:52:56 +00:00
Nhat Nguyen
b8b025c86d
Support cross clusters query in ESQL (#101640)
This pull request introduces support for cross-clusters query (CCQ) in 
ESQL. The enrich in CCQ will be implemented in a separate pull request
due to its complex semantic nature. The primary change occurs in the
ComputeService class, where a cluster-compute-action is introduced.

The implementation in this PR is equivalent to CCS with 
ccs_minimize_round_trips enabled. Currently, our plan is to support a
single mode in CCQ. At present, the coordinator on the remote cluster 
collects pages from data nodes in the same cluster and provides them to
the coordinator of the main cluster. This is achieved using two exchange
buffers, although a single exchange buffer could suffice. However, the
use of two buffers allows for future execution of a plan on this
coordinator to perform partial reduce operations, such as limit, topN,
and partial-to-partial aggregation.

Security and backward compatibility tests have been added in the 
multi-cluster-search-security and multi-clusters QA modules,
respectively.
2023-12-27 17:29:23 -08:00
David Turner
953b7ba99b AwaitsFix for #103717 2023-12-27 12:42:52 +00:00
Andrei Dan
2f0917d6a8
Add upgrade tests for installing the managed ilm/slm history templates (#103625)
This adds upgrade tests to validate the upgraded Elasticsearch version
will contain the latest ilm and slm history managed index templates.
2023-12-20 17:02:03 +00:00
Rene Groeschke
62ddafb0e0
Port smb fixture from test fixture plugin to testcontainer (#103440)
this removes smb test fixture to use test container instead of relying
on our gradle test fixture plugin.
2023-12-20 04:01:52 -05:00
Armin Braun
41d1665122
Fix SearchResponse leaks in REST and Enrich tests (#103533)
It's in the title, fix a couple of tests here and there. Also, fix REST
tests in particular and add a utility to cleanly read a SearchResponse
from a REST response without leaking the parser.

for #102030
2023-12-19 06:16:09 -05:00
Ryan Ernst
46667db0b4
Add IndexVersion constant for 8.13 (#103096)
This commit adds a dummy IndexVersion constant for 8.13. It is needed
for CCR tests which expect a different index version between current and
previous releases.
2023-12-14 06:27:25 -08:00
Johannes Fredén
6a4000cec6
Fix failing CI due to warning in Secure Settings Validation (#103307)
* Fix failing CI due to warning in Secure Settings Validation

* Validate settings in ReloadSecureSettings API (#103176)
2023-12-14 11:20:08 +01:00
Rene Groeschke
6e36ea841d
Port idp-fixture to testcontainers (#103320)
This ports idp-fixture to test container and updates downstream tests
accordingly.
2023-12-13 05:38:24 -05:00
Lorenzo Dematté
93bd1abf2a
Addressing more Version usages in tests (#102803) 2023-12-12 16:44:24 +01:00
Johannes Fredén
1676808a93
Revert "Validate settings in ReloadSecureSettings API (#103176)" (#103310)
* Revert "Validate settings in ReloadSecureSettings API (#103176)"

This reverts commit 4c55011e4c.

* Update docs/changelog/103310.yaml
2023-12-12 10:43:48 +01:00
Johannes Fredén
4c55011e4c
Validate settings in ReloadSecureSettings API (#103176)
* Validate settings in ReloadSecureSettings API
2023-12-12 09:23:31 +01:00
Lorenzo Dematté
72efee244b
Fix FullClusterRestartIT BwC tests (#103092) 2023-12-06 16:45:46 -08:00
Mark Vieira
99a840e5da
Mute CcrRollingUpgradeIT.testCannotFollowLeaderInUpgradedCluster 2023-12-06 16:41:12 -08:00
Lorenzo Dematté
9883f585ac
Fix SLM detection in tests (#103053) 2023-12-06 15:32:09 +01:00
Johannes Fredén
70b15945a9
Add ldap user metadata mappings for full name and email (#102925)
* Add ldap user metadata mappings for full name and email
2023-12-06 13:28:21 +01:00
Lorenzo Dematté
bbe9f115cc
More version removal/mitigation (#102867) 2023-12-05 10:18:49 +01:00
Lorenzo Dematté
df1b8f4c71
Java REST tests: more version -> feature update (#102761) 2023-12-01 08:18:14 +01:00
Simon Cooper
d3a5087c52
Remove some more old references to Version constants (#102526) 2023-11-24 14:52:06 +00: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
Armin Braun
a9c286b25c
Collapse verbose .execute().actionGet() calls in tests (#102502)
Cleaning this up a little even though it's still quite horrible.
`.get()` in this API actually means `actionGet()` so to speak.
I think a good first step to cleaning this up is to at least reduce
the duplication though and save 1k lines.
2023-11-23 10:10:10 +01:00